Haskell and Regex - Why doesn't my function eliminate RedundantSpaces?
1 answer
Text.Regex
uses Posix regular expressions and does not contain a shorthand acronym \s
(this is a perl extension that many other implementations do). You can use a group of characters instead [:space:]
, like:
eliminateRedundantSpaces text =
subRegex (mkRegex "[[:space:]]+") text " "
+10
source to share