Open timotheecour opened 3 years ago
What about passing a slice? or an openArray?
IIRC, match behaves differently from find for ^ when start > 0
Yeah, it does. Maybe it needs fixing.
What about passing a slice? or an openArray?
that would prevent using context eg lookaround:
(?=T|^S)suffi
note that this currently gives Invalid lookaround, expected closing symbol. Beware lookaround is currently limited to match one single character
but that's a limitation that (hopefully) will be lifted in the future (as in D's regex + other libs), so openArray would not help there.
Note that supporting openArray is independently useful.
Oh, a special case. I'll wait for re/nre to implement it anyway.
btw, is there a regex engine that has this feature? I tried Python's re, but it works just like re/nre.
I'm not sure; but supporting openArray
would indeed help in the meantime
I think this would be a useful feature (allowing ^
to match at position start
instead of fixed 0), whether as default behavior or with a flag.
Edit: Or alternatively, find/match procs that accept openArray[char]
for the input string.
following https://github.com/nitely/nim-regex/pull/67,
^
now refers to position 0 (instead of start) even if start > 0. We need a way to allow matching atposition = start
(ie emulate the behavior of^
before https://github.com/nitely/nim-regex/pull/67).As suggested here https://github.com/nitely/nim-regex/issues/64#issuecomment-622289959, how about adding a bool flag, treatStartAsStart, with perhaps a better name?
note