
Is anyone else seeing this problem:
:m +Text.Regex.Posix "\250" =~ "\250" :: Bool True "\250" =~ "[\250]" :: Bool False

On Tue, Dec 29, 2009 at 7:28 AM, David Fox
Is anyone else seeing this problem:
:m +Text.Regex.Posix "\250" =~ "\250" :: Bool True "\250" =~ "[\250]" :: Bool False
Paul Tanimoto suggested TDFA, which gets me most of the way there. However, it can't seem to handle "match anything except a dash":
"xyz" =~ "^[^-]*$" :: Bool *** Exception: Explict error in module Text.Regex.TDFA.String : Text.Regex.TDFA.String died: parseRegex for Text.Regex.TDFA.String failed:"^[^-]*$" (line 1, column 5): unexpected "]" expecting Failed to parse bracketed string

On Tue, Dec 29, 2009 at 10:23 AM, David Fox
On Tue, Dec 29, 2009 at 7:28 AM, David Fox
wrote: Is anyone else seeing this problem:
:m +Text.Regex.Posix "\250" =~ "\250" :: Bool True "\250" =~ "[\250]" :: Bool False
Paul Tanimoto suggested TDFA, which gets me most of the way there. However, it can't seem to handle "match anything except a dash":
"xyz" =~ "^[^-]*$" :: Bool *** Exception: Explict error in module Text.Regex.TDFA.String : Text.Regex.TDFA.String died: parseRegex for Text.Regex.TDFA.String failed:"^[^-]*$" (line 1, column 5): unexpected "]" expecting Failed to parse bracketed string
Hmm this seems to work: "^[^--]$"

On Tue, Dec 29, 2009 at 12:26 PM, David Fox
"xyz" =~ "^[^-]*$" :: Bool *** Exception: Explict error in module Text.Regex.TDFA.String : Text.Regex.TDFA.String died: parseRegex for Text.Regex.TDFA.String failed:"^[^-]*$" (line 1, column 5): unexpected "]" expecting Failed to parse bracketed string
Hmm this seems to work: "^[^--]$"
Strange. In that case, Regex.Posix seems to work correctly. How about using the bindings to PCRE instead? Chris also put a lot of information on his packages here: http://www.haskell.org/haskellwiki/Regex_Posix Paulo
participants (2)
-
David Fox
-
Paulo Tanimoto