There are several packages available for the usage of regular expressions in Haskell (e.g. Text.Regex.Base, Text.Regex.Posix etc.). Most packages I've seen so far use a subset of Regex I know, by which I mean: I am used to split a sentence into words with the following Regex:
\\w+ Nearly all packages in Haskell I tried so far don't support this (at least the earlier mentioned and Text.Regex.TDFA neither). I know that with Posix the usage of [[:word:]+] would have the same effect, but I would like to use the variant mentioned above.
From there are two questions:
- Is there any package to archive that?
- If there really is, why is there a different common usage?
- What advantages or disadvantages are there?
wordsthat does exactly what you want.wordswould attach them. E.g.:Prelude> words "Just a simple test."would result["Just","a","simple","test."]I want it without the dot.