Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- A type of zero-width assertion:
the
Bow
-predicate isTrue
if no input-data has yet been consumed; theStern
-predicate isTrue
if no input-data remains to be consumed. - Whilst at the top-level of the regex, the absence of an anchor is equivalent to a non-capturing
.*?
, tempting one to implement them using this property, it doesn't apply to those anchors encountered at either end of a sub-expression. So in all cases, an anchor constrains the permissible consumption of input-data, but at the top level it also prevents the regex drifting away from either end of the input-data.
- data Anchor
- type AnchorSpecification = (Maybe Anchor, Maybe Anchor)
- bowToken :: Char
- sternToken :: Char
- tokens :: String
- unanchored :: AnchorSpecification
Types
Data-types
Defines the types on anchor by which a regex can be moored to a part of the input-data.
Type-synonyms
type AnchorSpecification = (Maybe Anchor, Maybe Anchor) Source
A specification for the anchors required around the expression
Constants
sternToken :: Char Source
unanchored :: AnchorSpecification Source
The specification for an unanchored expression.