<div id="reply-content">
        have you considered using one of the many amazing HTML parsers on hackage?
    </div><div id="reply-content"><br></div><div id="reply-content">If the goal is to just get the HTML comments, that might be a much more effective use of your time</div>
    <div id="100EDC2DE5ED4DD2A4BF71255E6072EE"><div><br></div>--&nbsp;<br>Carter Tazio Schonwald<div><br></div></div>
     
    <p style="color: #A0A0A8;">On Friday, March 16, 2012 at 4:55 PM, Joseph Bozeman wrote:</p>
    <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
        <div id="quoted-message-content"><div>Hey everyone, I'm hoping someone can point me in the right direction.
<div><br></div><div>The regex-pcre package exports (=~) and (=~~) as two useful infix functions. They're great! The only problem is, they are a <i>positive</i>&nbsp;match for a regex. I have a file that contains HTML comments (it was generated in Word) and I really just want the barest text. I already have a function that strips out all the tags, and I have a function that finds all the links and sticks those in another file for later perusal.</div>
<div><br></div><div>What I'd like is advice on&nbsp;how to implement the (!~) and (!~~) operators. They should have the same types as (=~) and (=~~). I'm stuck, though. Here's the source for both of those functions: they depend on Text.Rege.PCRE package.</div>
<div><br></div><div><a name="v:-61--126-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-weight:bold;font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">(=~)</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;:: (</span><a href="http://hackage.haskell.org/packages/archive/regex-base/0.93.2/doc/html/Text-Regex-Base-RegexLike.html#t:RegexMaker" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">RegexMaker</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:Regex" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">Regex</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:CompOption" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">CompOption</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:ExecOption" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">ExecOption</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;source,&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-base/0.93.2/doc/html/Text-Regex-Base-RegexLike.html#t:RegexContext" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">RegexContext</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:Regex" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">Regex</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;source1 target) =&gt; source1 -&gt; source -&gt; target</span>&nbsp;<br>
</div><div><pre><span style="color:red">(</span><span>=~</span><span style="color:red">)</span> <span>x</span> <span>r</span> <span style="color:red">=</span> <span style="color:blue">let</span> <span>q</span> <span style="color:red">::</span> <span>Regex</span>
<a name="line-155"></a>               <span>q</span> <span style="color:red">=</span> <span>makeRegex</span> <span>r</span>
<a name="line-156"></a>           <span style="color:blue">in</span> <span>match</span> <span>q</span> <span>x</span></pre></div><div><br></div><div><a name="v:-61--126--126-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-weight:bold;font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">(=~~)</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;:: (</span><a href="http://hackage.haskell.org/packages/archive/regex-base/0.93.2/doc/html/Text-Regex-Base-RegexLike.html#t:RegexMaker" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">RegexMaker</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:Regex" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">Regex</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:CompOption" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">CompOption</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:ExecOption" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">ExecOption</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;source,&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-base/0.93.2/doc/html/Text-Regex-Base-RegexLike.html#t:RegexContext" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">RegexContext</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/regex-pcre/0.94.2/doc/html/Text-Regex-PCRE-Wrap.html#t:Regex" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">Regex</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;source1 target,&nbsp;</span><a href="http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Control-Monad.html#t:Monad" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">Monad</a><span style="font-family:monospace;font-size:13px;line-height:15px;text-align:left;background-color:rgb(240,240,240)">&nbsp;m) =&gt; source1 -&gt; source -&gt; m target</span><br>
</div><div><pre><span style="color:red">(</span><span>=~~</span><span style="color:red">)</span> <span>x</span> <span>r</span> <span style="color:red">=</span> <span style="color:blue">do</span> <span style="color:red">(</span><span>q</span> <span style="color:red">::</span> <span>Regex</span><span style="color:red">)</span> <span style="color:red">&lt;-</span>  <span>makeRegexM</span> <span>r</span>
<a name="line-160"></a>               <span>matchM</span> <span>q</span> <span>x</span></pre><pre>What I figured I could do was find a function that was the inverse of "match" and "matchM", but I can't find any in the docs. I really hope I don't have to implement <i>that</i>, too. I'm still new at this, and that seems like it would be over my head.</pre>
</div>
<div>_______________________________________________</div><div>Haskell-Cafe mailing list</div><div>Haskell-Cafe@haskell.org</div><div>http://www.haskell.org/mailman/listinfo/haskell-cafe</div></div></div>
         
         
         
         
    </blockquote>
     
    <div>
        <br>
    </div>