darcs-2.18.3: a distributed, interactive, smart revision control system
Safe HaskellSafe-Inferred
LanguageHaskell2010

Darcs.Util.Regex

Description

This module is a subset of the defunct regex-compat-tdfa.

Synopsis

Documentation

data Regex #

The TDFA backend specific Regex type, used by this module's RegexOptions and RegexMaker.

mkRegex :: String -> Regex Source #

Makes a regular expression with the default options (multi-line, case-sensitive). The syntax of regular expressions is otherwise that of egrep (i.e. POSIX "extended" regular expressions).

mkRegexWithOpts Source #

Arguments

:: String

The regular expression to compile

-> Bool

True <=> '^' and '$' match the beginning and end of individual lines respectively, and '.' does not match the newline character.

-> Bool

True <=> matching is case-sensitive

-> Regex

Returns: the compiled regular expression

Makes a regular expression, where the multi-line and case-sensitive options can be changed from the default settings.

matchRegex Source #

Arguments

:: Regex

The regular expression

-> String

The string to match against

-> Maybe [String]

Returns: Just strs if the match succeeded (and strs is the list of subexpression matches), or Nothing otherwise.

Match a regular expression against a string