regex-0.10.0.3: Toolkit for regex-base

Safe HaskellNone
LanguageHaskell2010

Text.RE.Tools.Lex

Contents

Synopsis

Documentation

alex :: IsRegex re s => [(re, Match s -> Maybe t)] -> t -> s -> [t] Source #

a simple regex-based scanner interpretter for prototyping scanners

alex' :: Replace s => (re -> s -> Match s) -> [(re, Match s -> Maybe t)] -> t -> s -> [t] Source #

a higher order version of alex parameterised over the matchOnce function

IsRegex

class Replace s => IsRegex re s where Source #

the IsRegex class allows tools to be written that will work with regex back end text type supported by the back end

Methods

matchOnce :: re -> s -> Match s Source #

finding the first match

matchMany :: re -> s -> Matches s Source #

finding all matches

makeRegex :: (Functor m, Monad m) => s -> m re Source #

compiling an RE, failing if the RE is not well formed

makeRegexWith :: (Functor m, Monad m) => SimpleREOptions -> s -> m re Source #

comiling an RE, specifying the SimpleREOptions

makeSearchReplace :: (Functor m, Monad m, IsRegex re s) => s -> s -> m (SearchReplace re s) Source #

compiling a SearchReplace template from the RE text and the template Text, failing if they are not well formed

makeSearchReplaceWith :: (Functor m, Monad m, IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s) Source #

compiling a SearchReplace template specifing the SimpleREOptions for the RE

makeEscaped :: (Functor m, Monad m) => (s -> s) -> s -> m re Source #

incorporate an escaped string into a compiled RE with the default options

makeEscapedWith :: (Functor m, Monad m) => SimpleREOptions -> (s -> s) -> s -> m re Source #

incorporate an escaped string into a compiled RE with the specified SimpleREOptions

regexSource :: re -> s Source #

extract the text of the RE from the RE

Text.RE

module Text.RE