regex-pderiv-0.2.0: Replaces/Enhances Text.Regex. Implementing regular expression matching using Antimirov's partial derivatives.

Safe HaskellSafe
LanguageHaskell98

Text.Regex.PDeriv.ByteString.TwoPasses

Synopsis

Documentation

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. Add the extended non-POSIX syntax described in Text.Regex.TDFA haddock documentation.

  • 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.

defaultCompOpt :: RegexOptions regex compOpt execOpt => compOpt #

defaultExecOpt :: RegexOptions regex compOpt execOpt => execOpt #

compile Source #

Arguments

:: CompOption

Flags (summed together)

-> ExecOption

Flags (summed together)

-> ByteString

The regular expression to compile

-> Either String Regex

Returns: the compiled regular expression

execute Source #

Arguments

:: Regex

Compiled regular expression

-> ByteString

ByteString to match against

-> Either String (Maybe Env) 

regexec Source #

Arguments

:: Regex

Compiled regular expression

-> ByteString

ByteString to match against

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