I am trying to use negative lookahead – standart regex-posix practice:
"foobarbaz" =~ "^(?!.*bar).*$" :: Bool
and getting error *** Exception: user error (Text.Regex.Posix.String died: (ReturnCode 13,"repetition-operator operand invalid"))
How can I use negative lookahead in Haskell?
1 Answers
Answers 1
Disclaimer: there are too many GREP dialects!
Your original GREP works on InDesign (it uses a slightly amended boost
implementation); so does this alternative:
^((?!bar).)*$
i.e., try to match (?!bar).
on each character in turn.
0 comments:
Post a Comment