When there are multiple possible local matches, but only one match leads to a global match.... #74

Open
opened 2021-05-08 16:12:10 +00:00 by benibela · 0 comments
benibela commented 2021-05-08 16:12:10 +00:00 (Migrated from github.com)

These should match:


assertMatch('([a-c]*)\1', 'abcabc'); //p282
assertMatch('(a)|\1', 'x'); //p294
assertMatch('(?:(b)?a)\1', 'a'); //p295
assertMatch('^((.)?a\2)+$', 'babadad'); //p303
assertMatch('(.*)\d+\1', 'abc12bc'); //p955
assertMatch('^.{3,4}(.+)\1$', 'foobarbar'); //p995
assertMatch('^(?:f|o|b){3,4}(.+)\1$', 'foobarbar'); //p996
assertMatch('^.{3,4}((?:b|a|r)+)\1$', 'foobarbar'); //p997
assertMatch('^(?:f|o|b){3,4}((?:b|a|r)+)\1$', 'foobarbar'); //p998
assertMatch('^.{3,4}(.+?)\1$', 'foobarbar'); //p999
assertMatch('^(?:f|o|b){3,4}(.+?)\1$', 'foobarbar'); //p1000
assertMatch('^.{3,4}((?:b|a|r)+?)\1$', 'foobarbar'); //p1001
assertMatch('^(?:f|o|b){3,4}((?:b|a|r)+?)\1$', 'foobarbar'); //p1002
assertMatch('^.{2,3}?(.+)\1$', 'foobarbar'); //p1003
assertMatch('^(?:f|o|b){2,3}?(.+)\1$', 'foobarbar'); //p1004
assertMatch('^.{2,3}?((?:b|a|r)+)\1$', 'foobarbar'); //p1005
assertMatch('^(?:f|o|b){2,3}?((?:b|a|r)+)\1$', 'foobarbar'); //p1006
assertMatch('^.{2,3}?(.+?)\1$', 'foobarbar'); //p1007
assertMatch('^(?:f|o|b){2,3}?(.+?)\1$', 'foobarbar'); //p1008
assertMatch('^.{2,3}?((?:b|a|r)+?)\1$', 'foobarbar'); //p1009
assertMatch('^(?:f|o|b){2,3}?((?:b|a|r)+?)\1$', 'foobarbar'); //p1010
assertMatch('^(.)(?:(.)+)*[BX]', 'ABCDE'); //p1705

the last one does not even have a backreference

flreperltest.txt

These should match: ``` assertMatch('([a-c]*)\1', 'abcabc'); //p282 assertMatch('(a)|\1', 'x'); //p294 assertMatch('(?:(b)?a)\1', 'a'); //p295 assertMatch('^((.)?a\2)+$', 'babadad'); //p303 assertMatch('(.*)\d+\1', 'abc12bc'); //p955 assertMatch('^.{3,4}(.+)\1$', 'foobarbar'); //p995 assertMatch('^(?:f|o|b){3,4}(.+)\1$', 'foobarbar'); //p996 assertMatch('^.{3,4}((?:b|a|r)+)\1$', 'foobarbar'); //p997 assertMatch('^(?:f|o|b){3,4}((?:b|a|r)+)\1$', 'foobarbar'); //p998 assertMatch('^.{3,4}(.+?)\1$', 'foobarbar'); //p999 assertMatch('^(?:f|o|b){3,4}(.+?)\1$', 'foobarbar'); //p1000 assertMatch('^.{3,4}((?:b|a|r)+?)\1$', 'foobarbar'); //p1001 assertMatch('^(?:f|o|b){3,4}((?:b|a|r)+?)\1$', 'foobarbar'); //p1002 assertMatch('^.{2,3}?(.+)\1$', 'foobarbar'); //p1003 assertMatch('^(?:f|o|b){2,3}?(.+)\1$', 'foobarbar'); //p1004 assertMatch('^.{2,3}?((?:b|a|r)+)\1$', 'foobarbar'); //p1005 assertMatch('^(?:f|o|b){2,3}?((?:b|a|r)+)\1$', 'foobarbar'); //p1006 assertMatch('^.{2,3}?(.+?)\1$', 'foobarbar'); //p1007 assertMatch('^(?:f|o|b){2,3}?(.+?)\1$', 'foobarbar'); //p1008 assertMatch('^.{2,3}?((?:b|a|r)+?)\1$', 'foobarbar'); //p1009 assertMatch('^(?:f|o|b){2,3}?((?:b|a|r)+?)\1$', 'foobarbar'); //p1010 assertMatch('^(.)(?:(.)+)*[BX]', 'ABCDE'); //p1705 ``` the last one does not even have a backreference [flreperltest.txt](https://github.com/BeRo1985/flre/files/6446144/flreperltest.txt)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BeRo1985/flre#74
No description provided.