regex-pderiv-0.0.8.2: Replaces/Enhances Text.Regex

Text.Regex.PDeriv.ByteString.LeftToRight

Synopsis

Documentation

data Regex Source

The PDeriv backend spepcific Regex type

data CompOption Source

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

Constructors

CompOption 

Fields

caseSensitive :: Bool

True in blankCompOpt and defaultCompOpt

multiline :: Bool

False in blankCompOpt, True in defaultCompOpt. Compile for newline-sensitive matching. By default, newline is a completely ordinary character with no special meaning in either REs or strings. With this flag, inverted bracket expressions and . never match newline, a ^ anchor matches the null string after any newline in the string in addition to its normal function, and the $ anchor matches the null string before any newline in the string in addition to its normal function.

rightAssoc :: Bool

True (and therefore Right associative) in blankCompOpt and defaultCompOpt

newSyntax :: Bool

False in blankCompOpt, True in defaultCompOpt.

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

Constructors

ExecOption 

Fields

captureGroups :: Bool

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

defaultCompOpt

Arguments

:: RegexOptions regex compOpt execOpt 
=> compOpt

reasonable options (extended,caseSensitive,multiline regex)

defaultExecOpt

Arguments

:: RegexOptions regex compOpt execOpt 
=> execOpt

reasonable options (extended,caseSensitive,multiline regex)

compileSource

Arguments

:: CompOption

Flags (summed together)

-> ExecOption

Flags (summed together)

-> ByteString

The regular expression to compile

-> Either String Regex

Returns: the compiled regular expression

executeSource

Arguments

:: Regex

Compiled regular expression

-> ByteString

ByteString to match against

-> Either String (Maybe Env) 

regexecSource

Arguments

:: Regex

Compiled regular expression

-> ByteString

ByteString to match against

-> Either String (Maybe (ByteString, ByteString, ByteString, [ByteString]))