
On Saturday 12 November 2011, 14:23:30, Shakthi Kannan wrote:
Hi,
--- On Sat, Nov 12, 2011 at 5:44 PM, Daniel Fischer
wrote: | Maybe the backreferences numbering starts at 0?
Not backreferences, but who cares?
| Worth a try.
\--
\0 represents the entire string match:
The entire *match*, that is, the part of the input matched by the regexp. The other entries correspond to parts matched by certain subregexen in the match.
http://cvs.haskell.org/Hugs/pages/libraries/base/Text-Regex.html
May I suggest using the docs at hackage, hugs hasn't had a release since 2006, I don't think the docs are up to date. Unless you're actually using hugs, in which case I suggest switching to ghc. http://hackage.haskell.org/package/regex-compat
Prelude Text.Regex> subRegex (mkRegex "e") "hello" "\\0" "hello"
Heh, I didn't see it immediately either ;)
Prelude Text.Regex> subRegex (mkRegex "e") "hello" ">\\0<"
"h>e