[Haskell-cafe] why no replace function in our regular expression libs ?

Clark Gaebel cgaebel at uwaterloo.ca
Fri Jan 25 20:17:46 CET 2013


I've needed this recently, too.

End result: I wrote an "Attoparsec.Parser Text", and ran the text through
that.

A regex would have been much nicer...

  - Clark


On Fri, Jan 25, 2013 at 2:06 PM, Simon Michael <simon at joyful.com> wrote:

> People have put a lot of work into regular expression libraries on
> haskell. Yet it seems very few of them provide a replace/substitute
> function - just regex-compat and regepr as far as I know. Why is that ?
> #haskell says:
>
> <sclv> iirc its because that's a really mutatey operation in the
> underlying c libs
> <sclv> should be simple enough to write a general purpose wrapper layer
> that uses captures to create the effect
>
> Secondly, as of today what do y'all do when you need that functionality
> ?
>
> -Simon
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130125/02398db9/attachment.htm>


More information about the Haskell-Cafe mailing list