-{-# OPTIONS -cpp #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Regex
--
-- 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".
--
-----------------------------------------------------------------------------
-#include "ghcconfig.h"
module Text.Regex (
-- * Regular expressions
Regex,
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
mkRegex,
mkRegexWithOpts,
matchRegex,
matchRegexAll
-#endif
) where
import Prelude
import Text.Regex.Posix ( Regex )
import System.IO.Unsafe
-#if !defined(__HUGS__) || defined(HAVE_REGEX_H)
-- | Makes a regular expression with the default options (multi-line,
-- case-sensitive). The syntax of regular expressions is
-- otherwise that of @egrep@ (i.e. POSIX \"extended\" regular
-- > subexpression matches )
matchRegexAll p str = unsafePerformIO (RE.regexec p str)
-
-#endif
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
--- Portability : non-portable (needs POSIX regexps)
+-- Portability : portable
--
-- Interface to the POSIX regular expression library.
--