JustParse-2.0: A simple and comprehensive Haskell parsing library

CopyrightCopyright Waived
LicensePublicDomain
Maintainergrantslatton@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

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 Match Source

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 Match Source

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

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

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

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

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