rex-0.4.3: A quasi-quoter for typeful results of regex captures.

Copyright(c) Michael Sloan 2011
MaintainerMichael Sloan (mgsloan@gmail.com)
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

Text.Regex.PCRE.Precompile

Description

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.

Synopsis

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.