JustParse-2.0: A simple and comprehensive Haskell parsing library

Portabilityportable
Stabilityexperimental
Maintainergrantslatton@gmail.com
Safe HaskellSafe

Data.JustParse.Language

Description

Allows for conversion from a regular expression and a Parser.

Synopsis

Documentation

data Match Source

The result of a regex

Constructors

Match 

Fields

matched :: String

The complete text matched within the regex

groups :: [Match]

Any submatches created by using capture groups

Instances

regex :: Stream s Char => String -> Parser s MatchSource

regex takes a regular expression in the form of a String and, if the regex is valid, returns a Parser that parses that regex. If the regex is invalid, it returns a Parser that will always fail. The returned parser is greedy.

regex_ :: Stream s Char => String -> Parser s MatchSource

Like regex, but returns a branching (non-greedy) parser.

regex' :: Stream s Char => String -> Parser s StringSource

The same as regex, but only returns the full matched text.

regex_' :: Stream s Char => String -> Parser s StringSource

The same as regex_, but only returns the full matched text.