regex-pcre-0.81: Replaces/Enhances Text.RegexContentsIndex
Text.Regex.PCRE.String
Contents
Types
Miscellaneous
Medium level API functions
Constants for CompOption
Constants for ExecOption
Description
This exports instances of the high level API and the medium level API of compile,execute, and regexec.
Synopsis
MatchOffset
MatchLength
compile :: CompOption -> ExecOption -> String -> IO (Either (MatchOffset, String) Regex)
execute :: Regex -> String -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
regexec :: Regex -> String -> IO (Either WrapError (Maybe (String, String, String, [String])))
Types
MatchOffset
MatchLength
Miscellaneous
Medium level API functions
compile
:: CompOptionFlags (summed together)
-> ExecOptionFlags (summed together)
-> StringThe regular expression to compile
-> IO (Either (MatchOffset, String) Regex)Returns: an error string and offset or the compiled regular expression
Compiles a regular expression
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 an array of (offset,length) pairs where index 0 is whole match, and the rest are the captured subexpressions.
Matches a regular expression against a string
regexec
:: Regexcompiled regular expression
-> Stringstring to match
-> IO (Either WrapError (Maybe (String, String, String, [String])))Returns: Nothing if no match, else (text before match, text after match, array of matches with 0 being the whole match)
execute match and extract substrings rather than just offsets
Constants for CompOption
Constants for ExecOption
Produced by Haddock version 0.8