regexdot-0.12.2.2: A polymorphic, POSIX, extended regex-engine.

Safe HaskellSafe
LanguageHaskell2010

RegExDot.Anchor

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • A type of zero-width assertion: the Bow-predicate is True if no input-data has yet been consumed; the Stern-predicate is True 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.
Synopsis

Types

Data-types

data Anchor Source #

Defines the types on anchor by which a regex can be moored to a part of the input-data.

Constructors

Bow

Matches only if no input data has yet been consumed. Can only exist at the start of the entire regex, or (in theory) the start of any alternative.

Stern

Matches only if no input data remains to be consumed. Can only exist at the end of the entire regex, or (in theory) the end of any alternative.

Instances
Eq Anchor Source # 
Instance details

Defined in RegExDot.Anchor

Methods

(==) :: Anchor -> Anchor -> Bool #

(/=) :: Anchor -> Anchor -> Bool #

Read Anchor Source # 
Instance details

Defined in RegExDot.Anchor

Show Anchor Source # 
Instance details

Defined in RegExDot.Anchor

NFData Anchor Source # 
Instance details

Defined in RegExDot.Anchor

Methods

rnf :: Anchor -> () #

Type-synonyms

type AnchorSpecification = (Maybe Anchor, Maybe Anchor) Source #

A specification for the anchors required around the expression

Constants

bowToken :: Char Source #

The conventional token used to denote a Bow-anchor, when in String-form.

sternToken :: Char Source #

The conventional token used to denote a Stern-anchor, when in String-form.

tokens :: String Source #

The set of Char to which a specific meaning is attributed, when reading from String.

unanchored :: AnchorSpecification Source #

The specification for an unanchored expression.