RE: Text.Regex bug in ghc 5.04.2

11 Apr
2003
11 Apr
'03
4:26 a.m.
After importing Text.Regex and Data.Maybe, here's some output from ghci:
*ProtoRegexp> fromJust $ matchRegex (mkRegex "foo") "barfoobaz" [] *ProtoRegexp> fromJust $ matchRegexAll (mkRegex "foo") "barfoobaz" ("ba","foo","baz",[])
I'm relatively sure those are both wrong. I think the first should be "foo" and the second should be ("bar","foo","baz",[])
I haven't yet tried Text.Regex.Posix to see if the problem is just the wrapper.
The first example is correct (it returns the parenthesised sub-expressions in the match). The second is indeed incorrect, there's an off-by-one in calculating the first component of the tuple, which I've now fixed. Thanks for the report. Cheers, Simon
8076
Age (days ago)
8076
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow