haskell regex substitution

Viewed 2347

Despite the ridiculously large number of regex matching engines for Haskell, the only one I can find that will substitute is Text.Regex, which, while decent, is missing a few thing I like from pcre. Are there any pcre-based packages which will do substitution, or am I stuck with this?

3 Answers

Update 2020

I totally agree with @rlpowell that

I don't think "just roll your own" is a reasonable answer to people trying to get actual work done, in an area where every other modern language has a trivial way to do this.

At the time of this writing, there is also Regex.Applicative.replace for regex substitution, though it's not Perl-compatible.

For pattern-matching and substitution with parsers instead of regex, there is Replace.Megaparsec.streamEdit

Related