weighted-regexp-0.3.1.1: Weighted Regular Expression Matcher

Stabilityexperimental
MaintainerSebastian Fischer <mailto:sebf@informatik.uni-kiel.de>
Safe HaskellNone

Text.RegExp.Matching.Leftmost

Description

This module implements leftmost matching based on weighted regular expressions. It should be imported qualified as the interface resembles that provided by other matching modules.

Synopsis

Documentation

matching :: RegExp c -> [c] -> Maybe MatchingSource

Returns the leftmost of all non-empty matchings for a regular expression in a given word. If the empty word is the only matching its position is zero.

data Matching Source

A Matching records the leftmost start index of a matching subword.

Instances

matchingIndex :: Matching -> IntSource

Start index of the matching subword in the queried word.

data Leftmost Source

Semiring used for leftmost matching.