haskell - Why is there a limit on the length of a regex pattern in Text.Regex.Posix? -
i'm seeing odd arbitrary limit on length of regular expression pattern where, after string of 30 characters, funny things start happen.
simple ghci example:
> import text.regex.posix > "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz0123" :: string "abcdefghijklmnopqrstuvwxyz0123" > "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz01234" :: string ""
the difference addition of 4
@ end of last pattern. it's valid regex , should match gives me empty string.
it gets weirder if add few more valid characters pattern:
> "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz01234567" :: string "ab"
it tells me matches ab
when that's wrong.
my environment:
- stack version 1.1.2 (resolver lts-6.7)
- ghc version 7.10.3
- os: windows 10
- regex-posix-0.95.2
a complete uninstall , reinstall of stack , packages did not solve problem
following this discussion, seems there other issues library stemming underlying c code not being ported 64-bit architecture.
i have switched regex-tdfa package , no longer have these problems.
Comments
Post a Comment