Copyright | (c) Michael Sloan 2011 |
---|---|
Maintainer | Michael Sloan (mgsloan@gmail.com) |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell98 |
This module provides support for accessing the compiled representation of PCRE regular expressions. This byte array encodes a lookup-table based representation for the regular expression, and can be safely written out and read back by compatible PCRE versions.
- type CompiledBytes = ByteString
- precompile :: ByteString -> [PCREOption] -> IO (Maybe CompiledBytes)
- regexToTable :: Regex -> IO (Maybe CompiledBytes)
- regexFromTable :: CompiledBytes -> IO Regex
Documentation
type CompiledBytes = ByteString Source
A synonym indicating which ByteStrings represent PCRE-format compiled data.
precompile :: ByteString -> [PCREOption] -> IO (Maybe CompiledBytes) Source
Compiles the given regular expression, and assuming nothing bad happens, yields the bytestring filled with PCRE's compiled representation.
regexToTable :: Regex -> IO (Maybe CompiledBytes) Source
Takes a compiled regular expression, and if successful, yields the compiled representation.
regexFromTable :: CompiledBytes -> IO Regex Source
Creates a regular expression from the compiled representation.