I'm seeing an odd arbitrary limit on the length of a regular expression pattern where, after a string of 30 characters, funny things start to happen.
Simple GHCI example:
> import Text.Regex.Posix
> "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz0123" :: String
"abcdefghijklmnopqrstuvwxyz0123"
> "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz01234" :: String
""
The only difference is the addition of the 4
at the end of the last pattern. It's a valid regex and should match but it gives me an empty string.
It gets even weirder if I add a few more valid characters to the pattern:
> "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz01234567" :: String
"ab"
It tells me it only matches ab
when clearly that's wrong.
My environment:
A complete uninstall and reinstall of Stack and all packages did not solve the problem
Following this discussion, it seems like there are other issues with this library stemming from the underlying C code not being properly ported to 64-bit architecture.
I have switched to the regex-tdfa package and no longer have these problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With