Michael,<br><br>Here is how I do it.<br><br><br>&gt; module Main where<br><br>&gt; import Text.Regex.Posix.ByteString<br>&gt; import Data.Maybe <br>&gt; import qualified Data.ByteString.Char8 as S<br><br>&gt; text = S.pack &quot;11\n abcd \n22&quot;<br>
&gt; p = S.pack &quot;11\n(.*)\n22&quot;<br><br><br>&gt; main :: IO ()<br>&gt; main = <br>&gt;  do  { (Right pat) &lt;- compile compExtended execBlank p<br>&gt;      ; res &lt;- regexec pat text<br>&gt;      ; case res of <br>
&gt;          { (Right (Just (_,_,_,m))) -&gt; putStrLn (show m)         <br>&gt;          ; _                        -&gt; putStrLn &quot;not matched.&quot;<br>&gt;          }<br>&gt;      } <br><br>You may swap out ByteString with String,<br>
PCRE should be similar, too.<br><br>Regards,<br>Kenny<br><br><br><div class="gmail_quote">On Wed, Nov 4, 2009 at 2:04 PM, Michael Mossey <span dir="ltr">&lt;<a href="mailto:mpm@alumni.caltech.edu">mpm@alumni.caltech.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<br>
kenny lu wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Michael,<br>
<br>
Could you give an example of what patterns you want to write?<br>
<br>
Regards,<br>
Kenny<br>
<br>
</blockquote>
<br></div>
Something like<br>
<br>
text = &quot;11\n abcd \n22&quot;<br>
answer = text =~ &quot;11.*22&quot; :: &lt;various possibilities&gt;<br>
<br>
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.<div>
<div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>