You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
regex-tdfa seems to have a non-standard multiline mode that combines what is usually known as "multiline" (i.e. having "^" and "$" match at the beginning/end of individual lines, not just the whole string) with inverse "dotall" and also disables matching newlines in inverted character classes (so you can't even use e.g. [^&] as you mentioned).
You can match a newline using "(.|\n)", but only with an actual newline in the pattern (since \n is just n to regex-tdfa).
> ("\n"=~~"(.|\n)") ::MaybeStringJust"\n"
It does recognise [[:space:]] though, so this works as well (in case your pattern is e.g. user input that can't contain a newline):
In GHCI:
The documentation says multiline matching should be enabled by default, but just to double-check, I tried enabling it explicitly:
No luck. The same thing happens for inverted character classes (e.g.,
[^&]
instead of.
). Am I misunderstanding how to get my regex to match newlines?The text was updated successfully, but these errors were encountered: