--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
--- Portability : non-portable (only on platforms that provide a regex lib)
+-- Portability : portable
--
-- Regular expression matching. Uses the POSIX regular expression
-- interface in "Text.Regex.Posix".
--
-----------------------------------------------------------------------------
-
module Text.Regex (
-- * Regular expressions
Regex,
mkRegex s = unsafePerformIO (RE.regcomp s RE.regExtended)
-- | Makes a regular expression, where the multi-line and
--- case-sensitve options can be changed from the default settings.
+-- case-sensitive options can be changed from the default settings.
mkRegexWithOpts
:: String -- ^ The regular expression to compile
- -> Bool -- ^ 'True' @\<=>@ '@^@' and '@$@' match the beginning and
- -- end of individual lines respectively, and '.' does /not/
+ -> Bool -- ^ 'True' @\<=>@ @\'^\'@ and @\'$\'@ match the beginning and
+ -- end of individual lines respectively, and @\'.\'@ does /not/
-- match the newline character.
-> Bool -- ^ 'True' @\<=>@ matching is case-sensitive
-> Regex -- ^ Returns: the compiled regular expression
-- > subexpression matches )
matchRegexAll p str = unsafePerformIO (RE.regexec p str)
-