I can\'t seem to find decent documentation on haskell\'s POSIX implementation.
Specifically the module Text.Regex.Posix.
Can anyone point me in the rig
You may need to import Text.Regex.Base.RegexLike for access to makeRegexOpts and friends.
extractToken body = match regex body where
regex = makeRegexOpts (defaultCompOpt - compNewline) defaultExecOpt
""
Well, since Text.Regex.Posix's defaultCompOpt = compExtended + compNewline, that works out equivalently as
extractToken body = match regex body where
regex = makeRegexOpts compExtended defaultExecOpt
""
To pull out just the first group, use one of the other instances of RegexLike. One possibility is
extractToken body = head groups where
(preMatch, inMatch, postMatch, groups) =
match regex body :: (String, String, String, [String])
regex = makeRegexOpts compExtended defaultExecOpt
""