regex-posix-0.72: Replaces/Enhances Text.RegexContentsIndex
Text.Regex.Posix.ByteString
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 ByteString instances for RegexMaker and RegexLike based on Text.Regex.Posix.Wrap, and a (RegexContext Regex ByteString ByteString) 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.

The ByteString will only be passed to the library efficiently (as a pointer) if it ends in a NUL byte. Otherwise a temporary copy must be made with the 0 byte appended.

Synopsis
MatchOffset
MatchLength
unusedOffset :: Int
compile :: CompOption -> ExecOption -> ByteString -> IO (Either WrapError 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
unusedOffset :: Int
Medium level API functions
compile
:: CompOptionFlags (summed together)
-> ExecOptionFlags (summed together)
-> ByteStringThe regular expression to compile
-> IO (Either WrapError 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])))
Compilation options
Execution options
Produced by Haddock version 0.8