[Haskell-beginners] wrapping text in a multiline string

Rico Moorman rico.moorman at gmail.com
Thu Jun 7 14:44:11 CEST 2012

> What's non-obvious and trip a lot of people when they try to use
> regexes in Haskell is that most regex libraries use the same
> interface, which is specified in the regex-base and consists of
> several typeclasses that offers a very high degree of flexibility.
> =~and =~~ are only the simplified front-ends to this and are pretty
> inadequate for advanced usages (for instance compile and use multiple
> time the same regex, you should really avoid =~ in this case, or
> additional regex compilation options). To see the basic interface,
> look at Text.Regex.Base.RegexLike :
> http://hackage.haskell.org/packages/archive/regex-base/latest/doc/html/Text-Regex-Base-RegexLike.html
> .
> In particular, what you want to do should be done with makeRegexOpts
> and match (or matchM), note that the available compilation and
> execution options can vary depending on the regex library you use and
> for regex-pcre, they're documented there :
> http://hackage.haskell.org/packages/archive/regex-pcre/latest/doc/html/Text-Regex-PCRE-Wrap.html#g:4
> --
> Jedaï

By the way, do you know other good resources on Regular expressions in
Haskell and especially the multiple backends (tdfa, posix and pcre
e.g.) in combination with the basic interface and how to use this all
together? Some example code would be really useful.

Furthermore the following page states that the Text.Regex.Base stuff
is being exported again by the newer/other regex modules.


Does this mean I should use the specific regex modules directly or
should I import the base and then specific functionality from the
engine modules?

Thank you very much in advance,

Best regards,


More information about the Beginners mailing list