|
Text.Regex.Posix.ByteString | Portability | non-portable (regex-base needs MPTC+FD) | Stability | experimental | Maintainer | libraries@haskell.org, textregexlazy@personal.mightyreason.com |
|
|
|
|
|
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 |
|
|
|
|
Types
|
|
MatchOffset |
|
MatchLength |
|
Miscellaneous
|
|
unusedOffset :: Int |
|
Medium level API functions
|
|
compile |
|
|
execute |
:: Regex | Compiled regular expression
| -> ByteString | String 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 |
|
|
Compilation options
|
|
Execution options
|
|
Produced by Haddock version 0.8 |