|
Language.HaLex.RegExp | Portability | portable | Stability | provisional | Maintainer | jas@di.uminho.pt |
|
|
|
|
|
Description |
Regular Expressions in Haskell. Code Included in the Lecture Notes on
Language Processing (with a functional flavour).
|
|
Synopsis |
|
|
|
|
Data type with recursion pattern |
|
data RegExp |
Type of regular expressions. | Constructors | Epsilon | | Literal Char | Literals | Or RegExp RegExp | Disjuncion | Then RegExp RegExp | Sequence | Star RegExp | Repetition, possibly zero time | OneOrMore RegExp | One or more times (extended RegExp) | Optional RegExp | Optional (extended RegExp) |
| Instances | |
|
|
cataRegExp :: (re, re -> re -> re, re -> re, Char -> re, re -> re -> re, re -> re, re -> re) -> RegExp -> re |
Catamorphism induced by the RegExp inductive data type |
|
Matching |
|
matchesRE :: RegExp -> [Char] -> Bool |
Test whether a match can be found for the given regular expression
in the given sequence of characters. The regular expression is
assumed not to contain OneOrMore or Optional. See also matches'. |
|
matches' :: RegExp -> [Char] -> Bool |
Test whether a match can be found for the given regular expression
in the given sequence of characters. The regular expression is
allowed to contain OneOrMore or Optional. |
|
Printing |
|
showRE :: RegExp -> [Char] |
Print regular expression to String. |
|
Normalization |
|
extREtoRE :: RegExp -> RegExp |
Rewrite extended regular expressions to
plain regular expression. This means that the OneOrMore
and Optional constructors are normalized away. |
|
Produced by Haddock version 0.6 |