{-# 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.TDFA
(
(*=~)
, (?=~)
, (*=~/)
, (?=~/)
, 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.TDFA.ByteString
, module Text.RE.TDFA.ByteString.Lazy
, module Text.RE.TDFA.Sequence
, module Text.RE.TDFA.String
, module Text.RE.TDFA.Text
, module Text.RE.TDFA.Text.Lazy
) where
import Control.Monad.Fail
import Text.RE.REOptions
import Text.RE.Replace
import Text.RE.TDFA.ByteString()
import Text.RE.TDFA.ByteString.Lazy()
import Text.RE.TDFA.Sequence()
import Text.RE.TDFA.String()
import Text.RE.TDFA.Text()
import Text.RE.TDFA.Text.Lazy()
import Text.RE.TestBench.Parsers
import Text.RE.Tools.IsRegex
import Text.RE.ZeInternals
import Text.RE.ZeInternals.SearchReplace.TDFA
import Text.RE.ZeInternals.TDFA
import qualified Text.Regex.Base as B
import qualified Text.Regex.TDFA as TDFA
(*=~) :: IsRegex RE s
=> s
-> RE
-> Matches 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
?=~ :: 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
*=~/ :: 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
?=~/ :: 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 TDFA.Regex s a
, B.RegexMaker TDFA.Regex TDFA.CompOption TDFA.ExecOption s
)
=> s
-> RE
-> a
=~ :: 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 TDFA.Regex s a
, B.RegexMaker TDFA.Regex TDFA.CompOption TDFA.ExecOption s
)
=> s
-> RE
-> m a
=~~ :: 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
B.matchM (RE -> Regex
reRegex RE
rex) s
bs