Here are some steps you can perform to make it working.
- Download from http://hackage.haskell.org/package/regex-compat-0.92, unzip to <Haskell Platform INSTALL FOLDER>2014.2.0.0lib
- Run Haskell.
- Type
:mod +Text.Regex
to load the package. - Type, e.g.
subRegex (mkRegex "[0-9]+") "foobar567" "123"
- Result is
"foobar123"
(after all packages are loaded).
Here is the subRegex description:
:: Regex Search pattern
-> String Input string
-> String Replacement text
-> String Output string
Replaces every occurance of the given regexp with the replacement
string.In the replacement string, “1” refers to the first substring; “2” to
the second, etc; and “