[Haskell-cafe] multi-line regex
Michael Mossey
mpm at alumni.caltech.edu
Wed Nov 4 01:04:23 EST 2009
kenny lu wrote:
> Hi Michael,
>
> Could you give an example of what patterns you want to write?
>
> Regards,
> Kenny
>
Something like
text = "11\n abcd \n22"
answer = text =~ "11.*22" :: <various possibilities>
and have it find the entire string. The default behavior is to stop
matching when it encounters a newline. There is mention in the
Text.Regex.Posix docs of a flag to control this behavior, but it is not
easy to figure out from the docs how to provide flags. The left-hand side
of the =~ is a very complex type.
More information about the Haskell-Cafe
mailing list