duckling-0.1.1.0: A Haskell library for parsing text into structured data.

Safe HaskellSafe
LanguageHaskell2010

Duckling.Engine.Regex

Synopsis

Documentation

matchAll :: RegexLike regex source => regex -> source -> [MatchArray] #

matchAll returns a list of matches. The matches are in order and do not overlap. If any match succeeds but has 0 length then this will be the last match in the list.

matchOnce :: RegexLike regex source => regex -> source -> Maybe MatchArray #

This returns the first match in the source (it checks the whole source, not just at the start). This returns an array of (offset,length) index pairs for the match and captured substrings. The offset is 0-based. A (-1) for an offset means a failure to match. The lower bound of the array is 0, and the 0th element is the (offset,length) for the whole match.