Is there any way to achieve the equivalent of a negative lookbehind in Dart regexp? I need to match a string that does not start and end with a specific set of characters.
I am unable to find a regex that does this without failing if the matched part is found at the beginning of the string. Negative lookbehinds seem to be the only answer, but Dart doesn't have one.
This is the regex that I would like to work, but it doesn't:
(?<!(Me\.)|[frFR])(text)(?!\w)
It would matched .text
or text=
but not Me.text
or FtextABC
Your answer lies here:
The thing is that DART regex has exactly the same power as Javascript regex. Much to lamentation of many, Javascript does not support lookbehinds. But that link will provide an answer.