regex-deriv-0.0.4: Replaces/Enhances Text.Regex. Implementing regular expression matching using Brzozowski's Deriviatives

Safe HaskellNone

Text.Regex.Deriv.RE

Synopsis

Documentation

data RE Source

data type of the regular expresions

Constructors

Phi 
Empty

an empty exp

L Char

a literal / a character

Choice [RE] GFlag

a choice exp 'r1 + r2'

ChoiceInt [RE]

internal choice used in the BitCode version

Seq RE RE

a pair exp '(r1,r2)'

Star RE GFlag

a kleene's star exp 'r*'

Any

.

Not [Char]

excluding characters e.g. [^abc]

Instances

resToRE :: [RE] -> RESource

function resToRE sums up a list of regular expressions with the choice operation.

partDeriv :: RE -> Char -> [RE]Source

function partDeriv implements the partial derivative operations for regular expressions. We don't pay attention to the greediness flag here.

sigmaRE :: RE -> [Char]Source

function sigmaRE returns all characters appearing in a reg exp.