regex-tdfa-1.1.0: Replaces/Enhances Text.Regex



Text.Regex.TDFA.Wrap provides the instance of RegexOptions and the definition of (=~) and (=~~). This is all re-exported by Text.Regex.TDFA.



data Regex Source

The TDFA backend specific Regex type, used by this module's RegexOptions and RegexMaker




regex_dfa :: DFA

starting DFA state

regex_init :: Index

index of starting state

regex_b_index :: (Index, Index)

indexes of smallest and largest states

regex_b_tags :: (Tag, Tag)

indexes of smallest and largest tags

regex_trie :: TrieSet DFA

All DFA states

regex_tags :: Array Tag OP

information about each tag

regex_groups :: Array GroupIndex [GroupInfo]

information about each group

regex_isFrontAnchored :: Bool

used for optimizing execution

regex_compOptions :: CompOption
regex_execOptions :: ExecOption

data CompOption Source

Control whether the pattern is multiline or case-sensitive like Text.Regex and whether to capture the subgroups (1, 2, etc).




caseSensitive :: Bool

True by default

multiline :: Bool

True by default, implies . and [^a] will not match '\n'

rightAssoc :: Bool

False (and therefore left associative) by default

lastStarGreedy :: Bool

False by default. This is POSIX correct but it takes space and is slower. Setting this to true will improve performance, and should be done if you plan to set the captureGroups execoption to False.

data ExecOption Source




captureGroups :: Bool

True by default. Set to False to improve speed (and space).

testMatch :: Bool

False by default. Set to True to quickly return shortest match (w/o groups). [ UNUSED ]

(=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> targetSource

This is the pure functional matching operator. If the target cannot be produced then some empty result will be returned. If there is an error in processing, then error will be called.

(=~~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target, Monad m) => source1 -> source -> m targetSource

This is the monadic matching operator. If a single match fails, then fail will be called.