regex-0.9.0.0: Toolkit for regex-base

Safe HaskellNone
LanguageHaskell2010

Text.RE.SearchReplace

Contents

Synopsis

Serach and Replace

data SearchReplace re s Source #

contains a compiled RE and replacement template

Constructors

SearchReplace 

Fields

Instances

Functor (SearchReplace re) Source # 

Methods

fmap :: (a -> b) -> SearchReplace re a -> SearchReplace re b #

(<$) :: a -> SearchReplace re b -> SearchReplace re a #

(Show s, Show re) => Show (SearchReplace re s) Source # 

Methods

showsPrec :: Int -> SearchReplace re s -> ShowS #

show :: SearchReplace re s -> String #

showList :: [SearchReplace re s] -> ShowS #

searchReplaceFirst :: IsRegex re s => SearchReplace re s -> s -> s Source #

search and replace

searchReplaceAll :: IsRegex re s => SearchReplace re s -> s -> s Source #

search and replace

unsafeCompileSearchReplace_ :: (String -> s) -> (String -> Either String re) -> String -> SearchReplace re s Source #

warapper on compileSearchReplace_ that will generate an error if any compilation errors are found

compileSearchReplace_ :: (Monad m, Functor m) => (String -> s) -> (String -> Either String re) -> String -> m (SearchReplace re s) Source #

compile a SearchReplace template generating errors if the RE or the template are not well formed -- all capture references being checked

compileSearchAndReplace_ :: (Monad m, Functor m) => (String -> s) -> (String -> Either String re) -> String -> String -> m (SearchReplace re s) Source #

compile SearcgReplace from two strings containing the RE and the replacement template