On Friday, March 16, 2012 at 7:08 PM, Joseph Bozeman wrote:
My goal is to remove the HTML comments. It probably would be at least as efficient to use an HTML parser, but I usually strip files by hand, and I always use regex then. I didn't want to bother importing yet another package, because if I could just get this line to work, I could get all my stripping done with three functions, and then I have four that I use to apply a template to the text once it's bare.On Fri, Mar 16, 2012 at 5:41 PM, Carter Tazio Schonwald <carter.schonwald@gmail.com> wrote:have you considered using one of the many amazing HTML parsers on hackage?If the goal is to just get the HTML comments, that might be a much more effective use of your time--
Carter Tazio SchonwaldOn Friday, March 16, 2012 at 4:55 PM, Joseph Bozeman wrote:
Hey everyone, I'm hoping someone can point me in the right direction.The regex-pcre package exports (=~) and (=~~) as two useful infix functions. They're great! The only problem is, they are a positive 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.What I'd like is advice on 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.(=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target
(=~~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target, Monad m) => source1 -> source -> m target
_______________________________________________Haskell-Cafe mailing list