regex-posix-0.72: Replaces/Enhances Text.RegexContentsIndex
Text.Regex.Posix.String
Portabilitynon-portable (regex-base needs MPTC+FD)
Stabilityexperimental
Maintainerlibraries@haskell.org, textregexlazy@personal.mightyreason.com
Contents
Types
Miscellaneous
Medium level API functions
Compilation options
Execution options
Description

This provides String instances for RegexMaker and RegexLike based on Text.Regex.Posix.Wrap, and a (RegexContext Regex String String) instance.

To use these instance, you would normally import Text.Regex.Posix. You only need to import this module to use the medium level API of the compile, regexec, and execute functions. All of these report error by returning Left values instead of undefined or error or fail.

Synopsis
MatchOffset
MatchLength
unusedOffset :: Int
compile :: CompOption -> ExecOption -> String -> IO (Either WrapError Regex)
regexec :: Regex -> String -> IO (Either WrapError (Maybe (String, String, String, [String])))
execute :: Regex -> String -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
Types
MatchOffset
MatchLength
Miscellaneous
unusedOffset :: Int
Medium level API functions
compile
:: CompOptionFlags (summed together)
-> ExecOptionFlags (summed together)
-> StringThe regular expression to compile (ASCII only, no null bytes)
-> IO (Either WrapError Regex)Returns: the compiled regular expression
regexec
:: RegexCompiled regular expression
-> StringString to match against
-> IO (Either WrapError (Maybe (String, String, String, [String])))

Returns: Nothing if the regex did not match the string, or:

   Just (everything before match,
         matched portion,
         everything after match,
         subexpression matches)
 
Matches a regular expression against a string
execute
:: RegexCompiled regular expression
-> StringString to match against
-> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))

Returns: Nothing if the regex did not match the string, or:

   Just (array of offset length pairs)
 
Matches a regular expression against a string
Compilation options
Execution options
Produced by Haddock version 0.8