{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
#endif
{-# OPTIONS_GHC -fno-warn-dodgy-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Text.RE.PCRE
(
(*=~)
, (?=~)
, (*=~/)
, (?=~/)
, Matches
, matchesSource
, allMatches
, anyMatches
, countMatches
, matches
, Match
, matchSource
, matched
, matchedText
, module Text.RE.TestBench.Parsers
, RE
, regexType
, reOptions
, reSource
, reCaptureNames
, reRegex
, SimpleREOptions(..)
, IsOption(..)
, REOptions
, defaultREOptions
, noPreludeREOptions
, unpackSimpleREOptions
, SearchReplace(..)
, compileRegex
, compileRegexWith
, compileRegexWithOptions
, compileSearchReplace
, compileSearchReplaceWith
, compileSearchReplaceWithOptions
, escape
, escapeWith
, escapeWithOptions
, escapeREString
, (=~)
, (=~~)
, re
, reMultilineSensitive
, reMultilineInsensitive
, reBlockSensitive
, reBlockInsensitive
, reMS
, reMI
, reBS
, reBI
, re_
, ed
, edMultilineSensitive
, edMultilineInsensitive
, edBlockSensitive
, edBlockInsensitive
, edMS
, edMI
, edBS
, edBI
, ed_
, cp
, prelude
, preludeEnv
, preludeTestsFailing
, preludeTable
, preludeSummary
, preludeSources
, preludeSource
, module Text.RE.Tools.IsRegex
, module Text.RE.PCRE.ByteString
, module Text.RE.PCRE.ByteString.Lazy
, module Text.RE.PCRE.Sequence
, module Text.RE.PCRE.String
) where
import Control.Monad.Fail
import Text.RE.PCRE.ByteString()
import Text.RE.PCRE.ByteString.Lazy()
import Text.RE.PCRE.Sequence()
import Text.RE.PCRE.String()
import Text.RE.REOptions
import Text.RE.Replace
import Text.RE.TestBench.Parsers
import Text.RE.Tools.IsRegex
import Text.RE.ZeInternals
import Text.RE.ZeInternals.PCRE
import Text.RE.ZeInternals.SearchReplace.PCRE
import qualified Text.Regex.Base as B
import qualified Text.Regex.PCRE as PCRE
(*=~) :: IsRegex RE s
=> s
-> RE
-> Matches s
*=~ :: forall s. IsRegex RE s => s -> RE -> Matches s
(*=~) s
bs RE
rex = CaptureNames -> Matches s -> Matches s
forall a. CaptureNames -> Matches a -> Matches a
addCaptureNamesToMatches (RE -> CaptureNames
reCaptureNames RE
rex) (Matches s -> Matches s) -> Matches s -> Matches s
forall a b. (a -> b) -> a -> b
$ RE -> s -> Matches s
forall re s. IsRegex re s => re -> s -> Matches s
matchMany RE
rex s
bs
(?=~) :: IsRegex RE s
=> s
-> RE
-> Match s
?=~ :: forall s. IsRegex RE s => s -> RE -> Match s
(?=~) s
bs RE
rex = CaptureNames -> Match s -> Match s
forall a. CaptureNames -> Match a -> Match a
addCaptureNamesToMatch (RE -> CaptureNames
reCaptureNames RE
rex) (Match s -> Match s) -> Match s -> Match s
forall a b. (a -> b) -> a -> b
$ RE -> s -> Match s
forall re s. IsRegex re s => re -> s -> Match s
matchOnce RE
rex s
bs
(*=~/) :: IsRegex RE s => s -> SearchReplace RE s -> s
*=~/ :: forall s. IsRegex RE s => s -> SearchReplace RE s -> s
(*=~/) = (SearchReplace RE s -> s -> s) -> s -> SearchReplace RE s -> s
forall a b c. (a -> b -> c) -> b -> a -> c
flip SearchReplace RE s -> s -> s
forall re s. IsRegex re s => SearchReplace re s -> s -> s
searchReplaceAll
(?=~/) :: IsRegex RE s => s -> SearchReplace RE s -> s
?=~/ :: forall s. IsRegex RE s => s -> SearchReplace RE s -> s
(?=~/) = (SearchReplace RE s -> s -> s) -> s -> SearchReplace RE s -> s
forall a b c. (a -> b -> c) -> b -> a -> c
flip SearchReplace RE s -> s -> s
forall re s. IsRegex re s => SearchReplace re s -> s -> s
searchReplaceFirst
(=~) :: ( B.RegexContext PCRE.Regex s a
, B.RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption s
)
=> s
-> RE
-> a
=~ :: forall s a.
(RegexContext Regex s a,
RegexMaker Regex CompOption ExecOption s) =>
s -> RE -> a
(=~) s
bs RE
rex = Regex -> s -> a
forall regex source target.
RegexContext regex source target =>
regex -> source -> target
B.match (RE -> Regex
reRegex RE
rex) s
bs
(=~~) :: ( Monad m, MonadFail m
, B.RegexContext PCRE.Regex s a
, B.RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption s
)
=> s
-> RE
-> m a
=~~ :: forall (m :: * -> *) s a.
(Monad m, MonadFail m, RegexContext Regex s a,
RegexMaker Regex CompOption ExecOption s) =>
s -> RE -> m a
(=~~) s
bs RE
rex = Regex -> s -> m a
forall regex source target (m :: * -> *).
(RegexContext regex source target, MonadFail m) =>
regex -> source -> m target
forall (m :: * -> *). MonadFail m => Regex -> s -> m a
B.matchM (RE -> Regex
reRegex RE
rex) s
bs