regex-pcre-0.81: Replaces/Enhances Text.RegexContentsIndex
Text.Regex.PCRE.ByteString
Contents
Types
Miscellaneous
Medium level API functions
CompOption flags
ExecOption flags
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 -> ByteString -> IO (Either (MatchOffset, String) Regex)
execute :: Regex -> ByteString -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
regexec :: Regex -> ByteString -> IO (Either WrapError (Maybe (ByteString, ByteString, ByteString, [ByteString])))
Types
MatchOffset
MatchLength
Miscellaneous
Medium level API functions
compile
:: CompOption(summed together)
-> ExecOption(summed together)
-> ByteStringThe regular expression to compile
-> IO (Either (MatchOffset, String) Regex)Returns: the compiled regular expression
Compiles a regular expression
execute
:: RegexCompiled regular expression
-> ByteStringString 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 buffer, returning the buffer indicies of the match, and any submatches

| Matches a regular expression against a string

regexec
:: RegexCompiled regular expression
-> ByteStringString to match against
-> IO (Either WrapError (Maybe (ByteString, ByteString, ByteString, [ByteString])))
CompOption flags
ExecOption flags
Produced by Haddock version 0.8