Haskell regex-pcre negate expression
How can I achieve an inverse match so that for example
getAllTextMatches $ "foobar bar bl a" =~ pattern :: [String]
would prodcuce a list of strings that are not multiple whitespace.
I've tried
getAllTextMatches $ "foobar bar bl a" =~ "(\\s\\s+)" :: [String]
which returns me this list as expected:
[" "," "," "]
Now I tried to negate the expression the following way
getAllTextMatches $ "foobar bar bl a" =~ "(?!\\s\\s+)" :: [String]
which returned
[""]
whereas I wanted to receive this:
["foobar", "bar", "bl", "a"]
No comments:
Post a Comment