regex-with-pcre-0.11.1.0: Toolkit for regex-base

Safe HaskellNone
LanguageHaskell2010

Text.RE.ZeInternals.PCRE

Contents

Synopsis

About

This module provides the regex PCRE back end. Most of the functions that you will need for day to day use are provided by the primary API modules (e.g., Text.RE.PCRE.ByteString).

RE Type

data RE Source #

the RE type for this back end representing a well-formed, compiled RE

regexType :: RegexType Source #

some functions in the Text.RE.TestBench need the back end to be passed dynamically as a RegexType parameters: use regexType fpr this backend

reOptions :: RE -> REOptions Source #

extract the REOptions from the RE

reSource :: RE -> String Source #

extract the RE source string from the RE

reCaptureNames :: RE -> CaptureNames Source #

extract the CaptureNames from the RE

reRegex :: RE -> Regex Source #

extract the back end compiled Regex type from the RE

REOptions Type

type REOptions = REOptions_ RE CompOption ExecOption Source #

and the REOptions for this back end (see Text.RE.REOptions for details)

noPreludeREOptions :: REOptions Source #

the default REOptions but with no RE macros defined

Compiling Regular Expressions

compileRegex :: (Functor m, Monad m) => String -> m RE Source #

compile a String into a RE with the default options, generating an error if the RE is not well formed

compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE Source #

compile a String into a RE using the given SimpleREOptions, generating an error if the RE is not well formed

compileRegexWithOptions :: (IsOption o RE CompOption ExecOption, Functor m, Monad m) => o -> String -> m RE Source #

compile a String into a RE using the given SimpleREOptions, generating an error if the RE is not well formed

Compiling Search-Replace Templates

compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> 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

compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s) Source #

compile a SearchReplace template, with simple options, generating errors if the RE or the template are not well formed, all capture references being checked

compileSearchReplaceWithREOptions :: (Monad m, Functor m, IsRegex RE s) => REOptions -> String -> String -> m (SearchReplace RE s) Source #

compile a SearchReplace template, with general options, generating errors if the RE or the template are not well formed, all capture references being checked

Escaping String

escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE Source #

convert a string into a RE that matches that string, and apply it to an argument continuation function to make up the RE string to be compiled; e.g., to compile a RE that will only match the string:

maybe undefined id . escape (("^"++) . (++"$"))

escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE Source #

a variant of escape where the SimpleREOptions are specified

escapeWithOptions :: (IsOption o RE CompOption ExecOption, Functor m, Monad m) => o -> (String -> String) -> String -> m RE Source #

a variant of escapeWith that allows an IsOption RE option to be specified

escapeREString :: String -> String #

Convert a string into a regular expression that will match that string

Macros Standard Environment

unpackSimpleREOptions :: SimpleREOptions -> REOptions Source #

convert a universal SimpleReOptions into the REOptions used by this back end

The Quasi Quoters

re :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reMS :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reMI :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reBS :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reBI :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reMultilineSensitive :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reMultilineInsensitive :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reBlockSensitive :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

reBlockInsensitive :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

re_ :: QuasiQuoter Source #

the [re| ... |] and [ed| ... /// ... |] quasi quoters

cp :: QuasiQuoter #

quasi quoter for CaptureID ([cp|0|],[cp|y|], etc.)

Orphan instances