regex-pcre-0.94: 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
data Regex
MatchOffset
MatchLength
newtype CompOption = CompOption CInt
newtype ExecOption = ExecOption CInt
data ReturnCode
type WrapError = (ReturnCode, String)
unusedOffset :: MatchOffset
getVersion :: Maybe String
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])))
compBlank :: CompOption
compAnchored :: CompOption
compAutoCallout :: CompOption
compCaseless :: CompOption
compDollarEndOnly :: CompOption
compDotAll :: CompOption
compExtended :: CompOption
compExtra :: CompOption
compFirstLine :: CompOption
compMultiline :: CompOption
compNoAutoCapture :: CompOption
compUngreedy :: CompOption
compUTF8 :: CompOption
compNoUTF8Check :: CompOption
execBlank :: ExecOption
execAnchored :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
execNotEmpty :: ExecOption
execNoUTF8Check :: ExecOption
execPartial :: ExecOption
Types
data Regex
A compiled regular expression
show/hide Instances
MatchOffset
MatchLength
newtype CompOption
Constructors
CompOption CInt
show/hide Instances
newtype ExecOption
Constructors
ExecOption CInt
show/hide Instances
data ReturnCode
show/hide Instances
type WrapError = (ReturnCode, String)
Miscellaneous
unusedOffset :: MatchOffset
getVersion :: Maybe String
return version of pcre used or Nothing if pcre is not available.
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
compBlank :: CompOption
compAnchored :: CompOption
compAutoCallout :: CompOption
compCaseless :: CompOption
compDollarEndOnly :: CompOption
compDotAll :: CompOption
compExtended :: CompOption
compExtra :: CompOption
compFirstLine :: CompOption
compMultiline :: CompOption
compNoAutoCapture :: CompOption
compUngreedy :: CompOption
compUTF8 :: CompOption
compNoUTF8Check :: CompOption
Constants for ExecOption
execBlank :: ExecOption
execAnchored :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
execNotEmpty :: ExecOption
execNoUTF8Check :: ExecOption
execPartial :: ExecOption
Produced by Haddock version 0.8