-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Toolkit for regex-base
--   
--   A regular expression toolkit for regex-base with compile-time checking
--   of RE syntax, data types for matches and captures, a text replacement
--   toolkit, portable options, high-level AWK-like tools for building text
--   processing apps, regular expression macros with parsers and test
--   bench, omprehensive documentation, tutorials and copious examples.
@package regex-with-pcre
@version 1.0.2.0

module Text.RE.PCRE.Text.Lazy

-- | find all the matches in the argument text; e.g., to count the number
--   of naturals in s:
--   
--   <pre>
--   countMatches $ s *=~ [re|[0-9]+|]
--   </pre>
(*=~) :: Text -> RE -> Matches Text

-- | find the first match in the argument text; e.g., to test if there is a
--   natural number in the input text:
--   
--   <pre>
--   matched $ s ?=~ [re|[0-9]+|]
--   </pre>
(?=~) :: Text -> RE -> Match Text

-- | search and replace all matches in the argument text; e.g., this
--   section will convert every YYYY-MM-DD format date in its argument text
--   into a DD/MM/YYYY date:
--   
--   <pre>
--   (*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])
--   </pre>
(*=~/) :: Text -> SearchReplace RE Text -> Text

-- | search and replace the first occurrence only (if any) in the input
--   text e.g., to prefix the first string of four hex digits in the input
--   text, if any, with <tt>0x</tt>:
--   
--   <pre>
--   (?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])
--   </pre>
(?=~/) :: Text -> SearchReplace RE Text -> Text

-- | the result of matching a RE against a text (with <tt>*=~</tt>),
--   retaining the text that was matched against
data Matches a

-- | the source text being matched
matchesSource :: Matches a -> a

-- | all <a>Match</a> instances found, left to right
allMatches :: Matches a -> [Match a]

-- | tests whether the RE matched the source text at all
anyMatches :: () => Matches a -> Bool

-- | count the matches
countMatches :: () => Matches a -> Int

-- | list the texts that Matched
matches :: () => Matches a -> [a]

-- | the result of matching a RE to a text once (with <tt>?=~</tt>),
--   retaining the text that was matched against
data Match a

-- | the whole source text
matchSource :: Match a -> a

-- | tests whether the RE matched the source text at all
matched :: () => Match a -> Bool

-- | yields the text matched by the RE, Nothing if no match
matchedText :: () => Match a -> Maybe a

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

-- | extract the RE source string from the <tt>RE</tt>
reSource :: RE -> String

-- | the default API uses these simple, universal RE options, which get
--   auto-converted into the apropriate back-end <a>REOptions_</a>
data SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of a line
MultilineSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matsh the start and end of a line
MultilineInsensitive :: SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of the input
--   text
BlockSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matching the start and end of the input
--   text
BlockInsensitive :: SimpleREOptions

-- | contains a compiled RE and replacement template
data SearchReplace re s
SearchReplace :: !re -> !s -> SearchReplace re s

-- | the RE to match a string to replace
[getSearch] :: SearchReplace re s -> !re

-- | the replacement template with ${cap} used to identify a capture (by
--   number or name if one was given) and <tt>$$</tt> being used to escape
--   a single <a>$</a>
[getTemplate] :: SearchReplace re s -> !s

-- | compile a <a>String</a> into a <a>RE</a> with the default options,
--   generating an error if the RE is not well formed
compileRegex :: (Functor m, Monad m) => String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE

-- | compile a SearchReplace template generating errors if the RE or the
--   template are not well formed, all capture references being checked
compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)

-- | compile a SearchReplace template, with simple options, 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)

-- | 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:
--   
--   <pre>
--   maybe undefined id . escape (("^"++) . (++"$"))
--   </pre>
escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE

-- | a variant of <a>escape</a> where the <a>SimpleREOptions</a> are
--   specified
escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE

-- | Convert a string into a regular expression that will match that string
escapeREString :: String -> String

-- | the `regex-base` polymorphic match operator
(=~) :: (Typeable a, RegexContext Regex Text a) => Text -> RE -> a

-- | the `regex-base` monadic, polymorphic match operator
(=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex Text a) => Text -> RE -> m a

-- | <tt>[re| ... |]</tt>, is equivalent to <tt>[reMultilineSensitive| ...
--   |]</tt>, compiling a case-sensitive, multi-line RE
re :: QuasiQuoter

-- | <tt>[reMultilineSensitive| ... |]</tt>, compiles a case-sensitive,
--   multi-line RE
reMultilineSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   multi-line RE
reMultilineInsensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-sensitive,
--   non-multi-line RE
reBlockSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   non-multi-line RE
reBlockInsensitive :: QuasiQuoter

-- | <tt>[reMS| ... |]</tt> is a shorthand for <tt>[reMultilineSensitive|
--   ... |]</tt>
reMS :: QuasiQuoter

-- | <tt>[reMI| ... |]</tt> is a shorthand for <tt>[reMultilineInsensitive|
--   ... |]</tt>
reMI :: QuasiQuoter

-- | <tt>[reBS| ... |]</tt> is a shorthand for <tt>[reBlockSensitive| ...
--   |]</tt>
reBS :: QuasiQuoter

-- | <tt>[reBI| ... |]</tt> is a shorthand for <tt>[reBlockInsensitive| ...
--   |]</tt>
reBI :: QuasiQuoter

-- | <tt>[re_| ... |]</tt> compiles a RE to produce a function that takes
--   the RE options (e.g., a <a>SimpleREOptions</a> value) and yields the
--   RE compiled with those options. For example,
--   
--   <pre>
--   countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive
--   </pre>
--   
--   counts the number of hexadecimal digit strings in <tt>s</tt>, allowing
--   upper- or lower-case hex didgits.
re_ :: QuasiQuoter

-- | <tt>[edMultilineSensitive| ... /// ... |]</tt> compiles a
--   case-sensitive, multi-line <a>SearchReplace</a> template
edMultilineSensitive :: QuasiQuoter

-- | <tt>[edMultilineInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, multi-line <a>SearchReplace</a> template
edMultilineInsensitive :: QuasiQuoter

-- | <tt>[edBlockSensitive| ... /// ... |]</tt> compiles a case-sensitive,
--   non-multi-line <a>SearchReplace</a> template
edBlockSensitive :: QuasiQuoter

-- | <tt>[edBlockInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, non-multi-line <a>SearchReplace</a> template
edBlockInsensitive :: QuasiQuoter

-- | <tt>[ed| ... /// ... |]</tt>, is equivalent to
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>, compiling a
--   case-sensitive, multi-line <a>SearchReplace</a>
ed :: QuasiQuoter

-- | <tt>[edMS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>
edMS :: QuasiQuoter

-- | <tt>[edMI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineInsensitive| ... /// ... |]</tt>
edMI :: QuasiQuoter

-- | <tt>[edBS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockSensitive| ... /// ... |]</tt>
edBS :: QuasiQuoter

-- | <tt>[edBI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockInsensitive| ... /// ... |]</tt>
edBI :: QuasiQuoter

-- | <tt>[ed_| ... /// ... |]</tt> compiles a <a>SearchReplace</a> template
--   to produce a function that takes the RE options (e.g., a
--   <a>SimpleREOptions</a> value) and yields the <a>SearchReplace</a>
--   template compiled with those options. For example,
--   
--   <pre>
--   s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive
--   </pre>
--   
--   prefixes the hexadecimal digit strings in s with <tt>0x</tt>, allowing
--   for upper- or lower-case hex didgits (which is entirely equivalent in
--   this example to just using
--   <tt>[edMultilineInsensitive|[0-9a-f]+|]</tt>).
ed_ :: QuasiQuoter

-- | quasi quoter for CaptureID: <tt>[cp|0|]</tt>, <tt>[cp|0|]</tt>, etc.,
--   indexing captures by classic positional numbers, and
--   <tt>[cp|foo|]</tt>, etc., referencing a named capture <tt>[re| ...
--   ${foo}( ... ) ... |]</tt>.
cp :: QuasiQuoter
instance Text.RE.ZeInternals.Types.IsRegex.IsRegex Text.RE.ZeInternals.PCRE.RE Data.Text.Internal.Lazy.Text

module Text.RE.PCRE.Text

-- | find all the matches in the argument text; e.g., to count the number
--   of naturals in s:
--   
--   <pre>
--   countMatches $ s *=~ [re|[0-9]+|]
--   </pre>
(*=~) :: Text -> RE -> Matches Text

-- | find the first match in the argument text; e.g., to test if there is a
--   natural number in the input text:
--   
--   <pre>
--   matched $ s ?=~ [re|[0-9]+|]
--   </pre>
(?=~) :: Text -> RE -> Match Text

-- | search and replace all matches in the argument text; e.g., this
--   section will convert every YYYY-MM-DD format date in its argument text
--   into a DD/MM/YYYY date:
--   
--   <pre>
--   (*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])
--   </pre>
(*=~/) :: Text -> SearchReplace RE Text -> Text

-- | search and replace the first occurrence only (if any) in the input
--   text e.g., to prefix the first string of four hex digits in the input
--   text, if any, with <tt>0x</tt>:
--   
--   <pre>
--   (?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])
--   </pre>
(?=~/) :: Text -> SearchReplace RE Text -> Text

-- | the result of matching a RE against a text (with <tt>*=~</tt>),
--   retaining the text that was matched against
data Matches a

-- | the source text being matched
matchesSource :: Matches a -> a

-- | all <a>Match</a> instances found, left to right
allMatches :: Matches a -> [Match a]

-- | tests whether the RE matched the source text at all
anyMatches :: () => Matches a -> Bool

-- | count the matches
countMatches :: () => Matches a -> Int

-- | list the texts that Matched
matches :: () => Matches a -> [a]

-- | the result of matching a RE to a text once (with <tt>?=~</tt>),
--   retaining the text that was matched against
data Match a

-- | the whole source text
matchSource :: Match a -> a

-- | tests whether the RE matched the source text at all
matched :: () => Match a -> Bool

-- | yields the text matched by the RE, Nothing if no match
matchedText :: () => Match a -> Maybe a

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

-- | extract the RE source string from the <tt>RE</tt>
reSource :: RE -> String

-- | the default API uses these simple, universal RE options, which get
--   auto-converted into the apropriate back-end <a>REOptions_</a>
data SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of a line
MultilineSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matsh the start and end of a line
MultilineInsensitive :: SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of the input
--   text
BlockSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matching the start and end of the input
--   text
BlockInsensitive :: SimpleREOptions

-- | contains a compiled RE and replacement template
data SearchReplace re s
SearchReplace :: !re -> !s -> SearchReplace re s

-- | the RE to match a string to replace
[getSearch] :: SearchReplace re s -> !re

-- | the replacement template with ${cap} used to identify a capture (by
--   number or name if one was given) and <tt>$$</tt> being used to escape
--   a single <a>$</a>
[getTemplate] :: SearchReplace re s -> !s

-- | compile a <a>String</a> into a <a>RE</a> with the default options,
--   generating an error if the RE is not well formed
compileRegex :: (Functor m, Monad m) => String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE

-- | compile a SearchReplace template generating errors if the RE or the
--   template are not well formed, all capture references being checked
compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)

-- | compile a SearchReplace template, with simple options, 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)

-- | 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:
--   
--   <pre>
--   maybe undefined id . escape (("^"++) . (++"$"))
--   </pre>
escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE

-- | a variant of <a>escape</a> where the <a>SimpleREOptions</a> are
--   specified
escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE

-- | Convert a string into a regular expression that will match that string
escapeREString :: String -> String

-- | the `regex-base` polymorphic match operator
(=~) :: (Typeable a, RegexContext Regex Text a) => Text -> RE -> a

-- | the `regex-base` monadic, polymorphic match operator
(=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex Text a) => Text -> RE -> m a

-- | <tt>[re| ... |]</tt>, is equivalent to <tt>[reMultilineSensitive| ...
--   |]</tt>, compiling a case-sensitive, multi-line RE
re :: QuasiQuoter

-- | <tt>[reMultilineSensitive| ... |]</tt>, compiles a case-sensitive,
--   multi-line RE
reMultilineSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   multi-line RE
reMultilineInsensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-sensitive,
--   non-multi-line RE
reBlockSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   non-multi-line RE
reBlockInsensitive :: QuasiQuoter

-- | <tt>[reMS| ... |]</tt> is a shorthand for <tt>[reMultilineSensitive|
--   ... |]</tt>
reMS :: QuasiQuoter

-- | <tt>[reMI| ... |]</tt> is a shorthand for <tt>[reMultilineInsensitive|
--   ... |]</tt>
reMI :: QuasiQuoter

-- | <tt>[reBS| ... |]</tt> is a shorthand for <tt>[reBlockSensitive| ...
--   |]</tt>
reBS :: QuasiQuoter

-- | <tt>[reBI| ... |]</tt> is a shorthand for <tt>[reBlockInsensitive| ...
--   |]</tt>
reBI :: QuasiQuoter

-- | <tt>[re_| ... |]</tt> compiles a RE to produce a function that takes
--   the RE options (e.g., a <a>SimpleREOptions</a> value) and yields the
--   RE compiled with those options. For example,
--   
--   <pre>
--   countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive
--   </pre>
--   
--   counts the number of hexadecimal digit strings in <tt>s</tt>, allowing
--   upper- or lower-case hex didgits.
re_ :: QuasiQuoter

-- | <tt>[edMultilineSensitive| ... /// ... |]</tt> compiles a
--   case-sensitive, multi-line <a>SearchReplace</a> template
edMultilineSensitive :: QuasiQuoter

-- | <tt>[edMultilineInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, multi-line <a>SearchReplace</a> template
edMultilineInsensitive :: QuasiQuoter

-- | <tt>[edBlockSensitive| ... /// ... |]</tt> compiles a case-sensitive,
--   non-multi-line <a>SearchReplace</a> template
edBlockSensitive :: QuasiQuoter

-- | <tt>[edBlockInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, non-multi-line <a>SearchReplace</a> template
edBlockInsensitive :: QuasiQuoter

-- | <tt>[ed| ... /// ... |]</tt>, is equivalent to
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>, compiling a
--   case-sensitive, multi-line <a>SearchReplace</a>
ed :: QuasiQuoter

-- | <tt>[edMS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>
edMS :: QuasiQuoter

-- | <tt>[edMI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineInsensitive| ... /// ... |]</tt>
edMI :: QuasiQuoter

-- | <tt>[edBS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockSensitive| ... /// ... |]</tt>
edBS :: QuasiQuoter

-- | <tt>[edBI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockInsensitive| ... /// ... |]</tt>
edBI :: QuasiQuoter

-- | <tt>[ed_| ... /// ... |]</tt> compiles a <a>SearchReplace</a> template
--   to produce a function that takes the RE options (e.g., a
--   <a>SimpleREOptions</a> value) and yields the <a>SearchReplace</a>
--   template compiled with those options. For example,
--   
--   <pre>
--   s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive
--   </pre>
--   
--   prefixes the hexadecimal digit strings in s with <tt>0x</tt>, allowing
--   for upper- or lower-case hex didgits (which is entirely equivalent in
--   this example to just using
--   <tt>[edMultilineInsensitive|[0-9a-f]+|]</tt>).
ed_ :: QuasiQuoter

-- | quasi quoter for CaptureID: <tt>[cp|0|]</tt>, <tt>[cp|0|]</tt>, etc.,
--   indexing captures by classic positional numbers, and
--   <tt>[cp|foo|]</tt>, etc., referencing a named capture <tt>[re| ...
--   ${foo}( ... ) ... |]</tt>.
cp :: QuasiQuoter
instance Text.RE.ZeInternals.Types.IsRegex.IsRegex Text.RE.ZeInternals.PCRE.RE Data.Text.Internal.Text

module Text.RE.PCRE.String

-- | find all the matches in the argument text; e.g., to count the number
--   of naturals in s:
--   
--   <pre>
--   countMatches $ s *=~ [re|[0-9]+|]
--   </pre>
(*=~) :: String -> RE -> Matches String

-- | find the first match in the argument text; e.g., to test if there is a
--   natural number in the input text:
--   
--   <pre>
--   matched $ s ?=~ [re|[0-9]+|]
--   </pre>
(?=~) :: String -> RE -> Match String

-- | search and replace all matches in the argument text; e.g., this
--   section will convert every YYYY-MM-DD format date in its argument text
--   into a DD/MM/YYYY date:
--   
--   <pre>
--   (*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])
--   </pre>
(*=~/) :: String -> SearchReplace RE String -> String

-- | search and replace the first occurrence only (if any) in the input
--   text e.g., to prefix the first string of four hex digits in the input
--   text, if any, with <tt>0x</tt>:
--   
--   <pre>
--   (?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])
--   </pre>
(?=~/) :: String -> SearchReplace RE String -> String

-- | the result of matching a RE against a text (with <tt>*=~</tt>),
--   retaining the text that was matched against
data Matches a

-- | the source text being matched
matchesSource :: Matches a -> a

-- | all <a>Match</a> instances found, left to right
allMatches :: Matches a -> [Match a]

-- | tests whether the RE matched the source text at all
anyMatches :: () => Matches a -> Bool

-- | count the matches
countMatches :: () => Matches a -> Int

-- | list the texts that Matched
matches :: () => Matches a -> [a]

-- | the result of matching a RE to a text once (with <tt>?=~</tt>),
--   retaining the text that was matched against
data Match a

-- | the whole source text
matchSource :: Match a -> a

-- | tests whether the RE matched the source text at all
matched :: () => Match a -> Bool

-- | yields the text matched by the RE, Nothing if no match
matchedText :: () => Match a -> Maybe a

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

-- | extract the RE source string from the <tt>RE</tt>
reSource :: RE -> String

-- | the default API uses these simple, universal RE options, which get
--   auto-converted into the apropriate back-end <a>REOptions_</a>
data SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of a line
MultilineSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matsh the start and end of a line
MultilineInsensitive :: SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of the input
--   text
BlockSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matching the start and end of the input
--   text
BlockInsensitive :: SimpleREOptions

-- | contains a compiled RE and replacement template
data SearchReplace re s
SearchReplace :: !re -> !s -> SearchReplace re s

-- | the RE to match a string to replace
[getSearch] :: SearchReplace re s -> !re

-- | the replacement template with ${cap} used to identify a capture (by
--   number or name if one was given) and <tt>$$</tt> being used to escape
--   a single <a>$</a>
[getTemplate] :: SearchReplace re s -> !s

-- | compile a <a>String</a> into a <a>RE</a> with the default options,
--   generating an error if the RE is not well formed
compileRegex :: (Functor m, Monad m) => String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE

-- | compile a SearchReplace template generating errors if the RE or the
--   template are not well formed, all capture references being checked
compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)

-- | compile a SearchReplace template, with simple options, 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)

-- | 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:
--   
--   <pre>
--   maybe undefined id . escape (("^"++) . (++"$"))
--   </pre>
escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE

-- | a variant of <a>escape</a> where the <a>SimpleREOptions</a> are
--   specified
escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE

-- | Convert a string into a regular expression that will match that string
escapeREString :: String -> String

-- | the `regex-base` polymorphic match operator
(=~) :: (Typeable a, RegexContext Regex String a) => String -> RE -> a

-- | the `regex-base` monadic, polymorphic match operator
(=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex String a) => String -> RE -> m a

-- | <tt>[re| ... |]</tt>, is equivalent to <tt>[reMultilineSensitive| ...
--   |]</tt>, compiling a case-sensitive, multi-line RE
re :: QuasiQuoter

-- | <tt>[reMultilineSensitive| ... |]</tt>, compiles a case-sensitive,
--   multi-line RE
reMultilineSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   multi-line RE
reMultilineInsensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-sensitive,
--   non-multi-line RE
reBlockSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   non-multi-line RE
reBlockInsensitive :: QuasiQuoter

-- | <tt>[reMS| ... |]</tt> is a shorthand for <tt>[reMultilineSensitive|
--   ... |]</tt>
reMS :: QuasiQuoter

-- | <tt>[reMI| ... |]</tt> is a shorthand for <tt>[reMultilineInsensitive|
--   ... |]</tt>
reMI :: QuasiQuoter

-- | <tt>[reBS| ... |]</tt> is a shorthand for <tt>[reBlockSensitive| ...
--   |]</tt>
reBS :: QuasiQuoter

-- | <tt>[reBI| ... |]</tt> is a shorthand for <tt>[reBlockInsensitive| ...
--   |]</tt>
reBI :: QuasiQuoter

-- | <tt>[re_| ... |]</tt> compiles a RE to produce a function that takes
--   the RE options (e.g., a <a>SimpleREOptions</a> value) and yields the
--   RE compiled with those options. For example,
--   
--   <pre>
--   countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive
--   </pre>
--   
--   counts the number of hexadecimal digit strings in <tt>s</tt>, allowing
--   upper- or lower-case hex didgits.
re_ :: QuasiQuoter

-- | <tt>[edMultilineSensitive| ... /// ... |]</tt> compiles a
--   case-sensitive, multi-line <a>SearchReplace</a> template
edMultilineSensitive :: QuasiQuoter

-- | <tt>[edMultilineInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, multi-line <a>SearchReplace</a> template
edMultilineInsensitive :: QuasiQuoter

-- | <tt>[edBlockSensitive| ... /// ... |]</tt> compiles a case-sensitive,
--   non-multi-line <a>SearchReplace</a> template
edBlockSensitive :: QuasiQuoter

-- | <tt>[edBlockInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, non-multi-line <a>SearchReplace</a> template
edBlockInsensitive :: QuasiQuoter

-- | <tt>[ed| ... /// ... |]</tt>, is equivalent to
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>, compiling a
--   case-sensitive, multi-line <a>SearchReplace</a>
ed :: QuasiQuoter

-- | <tt>[edMS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>
edMS :: QuasiQuoter

-- | <tt>[edMI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineInsensitive| ... /// ... |]</tt>
edMI :: QuasiQuoter

-- | <tt>[edBS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockSensitive| ... /// ... |]</tt>
edBS :: QuasiQuoter

-- | <tt>[edBI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockInsensitive| ... /// ... |]</tt>
edBI :: QuasiQuoter

-- | <tt>[ed_| ... /// ... |]</tt> compiles a <a>SearchReplace</a> template
--   to produce a function that takes the RE options (e.g., a
--   <a>SimpleREOptions</a> value) and yields the <a>SearchReplace</a>
--   template compiled with those options. For example,
--   
--   <pre>
--   s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive
--   </pre>
--   
--   prefixes the hexadecimal digit strings in s with <tt>0x</tt>, allowing
--   for upper- or lower-case hex didgits (which is entirely equivalent in
--   this example to just using
--   <tt>[edMultilineInsensitive|[0-9a-f]+|]</tt>).
ed_ :: QuasiQuoter

-- | quasi quoter for CaptureID: <tt>[cp|0|]</tt>, <tt>[cp|0|]</tt>, etc.,
--   indexing captures by classic positional numbers, and
--   <tt>[cp|foo|]</tt>, etc., referencing a named capture <tt>[re| ...
--   ${foo}( ... ) ... |]</tt>.
cp :: QuasiQuoter
instance Text.RE.ZeInternals.Types.IsRegex.IsRegex Text.RE.ZeInternals.PCRE.RE GHC.Base.String

module Text.RE.PCRE.Sequence

-- | find all the matches in the argument text; e.g., to count the number
--   of naturals in s:
--   
--   <pre>
--   countMatches $ s *=~ [re|[0-9]+|]
--   </pre>
(*=~) :: (Seq Char) -> RE -> Matches (Seq Char)

-- | find the first match in the argument text; e.g., to test if there is a
--   natural number in the input text:
--   
--   <pre>
--   matched $ s ?=~ [re|[0-9]+|]
--   </pre>
(?=~) :: (Seq Char) -> RE -> Match (Seq Char)

-- | search and replace all matches in the argument text; e.g., this
--   section will convert every YYYY-MM-DD format date in its argument text
--   into a DD/MM/YYYY date:
--   
--   <pre>
--   (*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])
--   </pre>
(*=~/) :: (Seq Char) -> SearchReplace RE (Seq Char) -> (Seq Char)

-- | search and replace the first occurrence only (if any) in the input
--   text e.g., to prefix the first string of four hex digits in the input
--   text, if any, with <tt>0x</tt>:
--   
--   <pre>
--   (?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])
--   </pre>
(?=~/) :: (Seq Char) -> SearchReplace RE (Seq Char) -> (Seq Char)

-- | the result of matching a RE against a text (with <tt>*=~</tt>),
--   retaining the text that was matched against
data Matches a

-- | the source text being matched
matchesSource :: Matches a -> a

-- | all <a>Match</a> instances found, left to right
allMatches :: Matches a -> [Match a]

-- | tests whether the RE matched the source text at all
anyMatches :: () => Matches a -> Bool

-- | count the matches
countMatches :: () => Matches a -> Int

-- | list the texts that Matched
matches :: () => Matches a -> [a]

-- | the result of matching a RE to a text once (with <tt>?=~</tt>),
--   retaining the text that was matched against
data Match a

-- | the whole source text
matchSource :: Match a -> a

-- | tests whether the RE matched the source text at all
matched :: () => Match a -> Bool

-- | yields the text matched by the RE, Nothing if no match
matchedText :: () => Match a -> Maybe a

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

-- | extract the RE source string from the <tt>RE</tt>
reSource :: RE -> String

-- | the default API uses these simple, universal RE options, which get
--   auto-converted into the apropriate back-end <a>REOptions_</a>
data SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of a line
MultilineSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matsh the start and end of a line
MultilineInsensitive :: SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of the input
--   text
BlockSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matching the start and end of the input
--   text
BlockInsensitive :: SimpleREOptions

-- | contains a compiled RE and replacement template
data SearchReplace re s
SearchReplace :: !re -> !s -> SearchReplace re s

-- | the RE to match a string to replace
[getSearch] :: SearchReplace re s -> !re

-- | the replacement template with ${cap} used to identify a capture (by
--   number or name if one was given) and <tt>$$</tt> being used to escape
--   a single <a>$</a>
[getTemplate] :: SearchReplace re s -> !s

-- | compile a <a>String</a> into a <a>RE</a> with the default options,
--   generating an error if the RE is not well formed
compileRegex :: (Functor m, Monad m) => String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE

-- | compile a SearchReplace template generating errors if the RE or the
--   template are not well formed, all capture references being checked
compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)

-- | compile a SearchReplace template, with simple options, 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)

-- | 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:
--   
--   <pre>
--   maybe undefined id . escape (("^"++) . (++"$"))
--   </pre>
escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE

-- | a variant of <a>escape</a> where the <a>SimpleREOptions</a> are
--   specified
escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE

-- | Convert a string into a regular expression that will match that string
escapeREString :: String -> String

-- | the `regex-base` polymorphic match operator
(=~) :: (Typeable a, RegexContext Regex (Seq Char) a) => (Seq Char) -> RE -> a

-- | the `regex-base` monadic, polymorphic match operator
(=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex (Seq Char) a) => (Seq Char) -> RE -> m a

-- | <tt>[re| ... |]</tt>, is equivalent to <tt>[reMultilineSensitive| ...
--   |]</tt>, compiling a case-sensitive, multi-line RE
re :: QuasiQuoter

-- | <tt>[reMultilineSensitive| ... |]</tt>, compiles a case-sensitive,
--   multi-line RE
reMultilineSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   multi-line RE
reMultilineInsensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-sensitive,
--   non-multi-line RE
reBlockSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   non-multi-line RE
reBlockInsensitive :: QuasiQuoter

-- | <tt>[reMS| ... |]</tt> is a shorthand for <tt>[reMultilineSensitive|
--   ... |]</tt>
reMS :: QuasiQuoter

-- | <tt>[reMI| ... |]</tt> is a shorthand for <tt>[reMultilineInsensitive|
--   ... |]</tt>
reMI :: QuasiQuoter

-- | <tt>[reBS| ... |]</tt> is a shorthand for <tt>[reBlockSensitive| ...
--   |]</tt>
reBS :: QuasiQuoter

-- | <tt>[reBI| ... |]</tt> is a shorthand for <tt>[reBlockInsensitive| ...
--   |]</tt>
reBI :: QuasiQuoter

-- | <tt>[re_| ... |]</tt> compiles a RE to produce a function that takes
--   the RE options (e.g., a <a>SimpleREOptions</a> value) and yields the
--   RE compiled with those options. For example,
--   
--   <pre>
--   countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive
--   </pre>
--   
--   counts the number of hexadecimal digit strings in <tt>s</tt>, allowing
--   upper- or lower-case hex didgits.
re_ :: QuasiQuoter

-- | <tt>[edMultilineSensitive| ... /// ... |]</tt> compiles a
--   case-sensitive, multi-line <a>SearchReplace</a> template
edMultilineSensitive :: QuasiQuoter

-- | <tt>[edMultilineInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, multi-line <a>SearchReplace</a> template
edMultilineInsensitive :: QuasiQuoter

-- | <tt>[edBlockSensitive| ... /// ... |]</tt> compiles a case-sensitive,
--   non-multi-line <a>SearchReplace</a> template
edBlockSensitive :: QuasiQuoter

-- | <tt>[edBlockInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, non-multi-line <a>SearchReplace</a> template
edBlockInsensitive :: QuasiQuoter

-- | <tt>[ed| ... /// ... |]</tt>, is equivalent to
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>, compiling a
--   case-sensitive, multi-line <a>SearchReplace</a>
ed :: QuasiQuoter

-- | <tt>[edMS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>
edMS :: QuasiQuoter

-- | <tt>[edMI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineInsensitive| ... /// ... |]</tt>
edMI :: QuasiQuoter

-- | <tt>[edBS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockSensitive| ... /// ... |]</tt>
edBS :: QuasiQuoter

-- | <tt>[edBI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockInsensitive| ... /// ... |]</tt>
edBI :: QuasiQuoter

-- | <tt>[ed_| ... /// ... |]</tt> compiles a <a>SearchReplace</a> template
--   to produce a function that takes the RE options (e.g., a
--   <a>SimpleREOptions</a> value) and yields the <a>SearchReplace</a>
--   template compiled with those options. For example,
--   
--   <pre>
--   s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive
--   </pre>
--   
--   prefixes the hexadecimal digit strings in s with <tt>0x</tt>, allowing
--   for upper- or lower-case hex didgits (which is entirely equivalent in
--   this example to just using
--   <tt>[edMultilineInsensitive|[0-9a-f]+|]</tt>).
ed_ :: QuasiQuoter

-- | quasi quoter for CaptureID: <tt>[cp|0|]</tt>, <tt>[cp|0|]</tt>, etc.,
--   indexing captures by classic positional numbers, and
--   <tt>[cp|foo|]</tt>, etc., referencing a named capture <tt>[re| ...
--   ${foo}( ... ) ... |]</tt>.
cp :: QuasiQuoter
instance Text.RE.ZeInternals.Types.IsRegex.IsRegex Text.RE.ZeInternals.PCRE.RE (Data.Sequence.Internal.Seq GHC.Types.Char)

module Text.RE.PCRE.ByteString.Lazy

-- | find all the matches in the argument text; e.g., to count the number
--   of naturals in s:
--   
--   <pre>
--   countMatches $ s *=~ [re|[0-9]+|]
--   </pre>
(*=~) :: ByteString -> RE -> Matches ByteString

-- | find the first match in the argument text; e.g., to test if there is a
--   natural number in the input text:
--   
--   <pre>
--   matched $ s ?=~ [re|[0-9]+|]
--   </pre>
(?=~) :: ByteString -> RE -> Match ByteString

-- | search and replace all matches in the argument text; e.g., this
--   section will convert every YYYY-MM-DD format date in its argument text
--   into a DD/MM/YYYY date:
--   
--   <pre>
--   (*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])
--   </pre>
(*=~/) :: ByteString -> SearchReplace RE ByteString -> ByteString

-- | search and replace the first occurrence only (if any) in the input
--   text e.g., to prefix the first string of four hex digits in the input
--   text, if any, with <tt>0x</tt>:
--   
--   <pre>
--   (?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])
--   </pre>
(?=~/) :: ByteString -> SearchReplace RE ByteString -> ByteString

-- | the result of matching a RE against a text (with <tt>*=~</tt>),
--   retaining the text that was matched against
data Matches a

-- | the source text being matched
matchesSource :: Matches a -> a

-- | all <a>Match</a> instances found, left to right
allMatches :: Matches a -> [Match a]

-- | tests whether the RE matched the source text at all
anyMatches :: () => Matches a -> Bool

-- | count the matches
countMatches :: () => Matches a -> Int

-- | list the texts that Matched
matches :: () => Matches a -> [a]

-- | the result of matching a RE to a text once (with <tt>?=~</tt>),
--   retaining the text that was matched against
data Match a

-- | the whole source text
matchSource :: Match a -> a

-- | tests whether the RE matched the source text at all
matched :: () => Match a -> Bool

-- | yields the text matched by the RE, Nothing if no match
matchedText :: () => Match a -> Maybe a

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

-- | extract the RE source string from the <tt>RE</tt>
reSource :: RE -> String

-- | the default API uses these simple, universal RE options, which get
--   auto-converted into the apropriate back-end <a>REOptions_</a>
data SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of a line
MultilineSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matsh the start and end of a line
MultilineInsensitive :: SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of the input
--   text
BlockSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matching the start and end of the input
--   text
BlockInsensitive :: SimpleREOptions

-- | contains a compiled RE and replacement template
data SearchReplace re s
SearchReplace :: !re -> !s -> SearchReplace re s

-- | the RE to match a string to replace
[getSearch] :: SearchReplace re s -> !re

-- | the replacement template with ${cap} used to identify a capture (by
--   number or name if one was given) and <tt>$$</tt> being used to escape
--   a single <a>$</a>
[getTemplate] :: SearchReplace re s -> !s

-- | compile a <a>String</a> into a <a>RE</a> with the default options,
--   generating an error if the RE is not well formed
compileRegex :: (Functor m, Monad m) => String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE

-- | compile a SearchReplace template generating errors if the RE or the
--   template are not well formed, all capture references being checked
compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)

-- | compile a SearchReplace template, with simple options, 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)

-- | 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:
--   
--   <pre>
--   maybe undefined id . escape (("^"++) . (++"$"))
--   </pre>
escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE

-- | a variant of <a>escape</a> where the <a>SimpleREOptions</a> are
--   specified
escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE

-- | Convert a string into a regular expression that will match that string
escapeREString :: String -> String

-- | the `regex-base` polymorphic match operator
(=~) :: (Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> a

-- | the `regex-base` monadic, polymorphic match operator
(=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a

-- | <tt>[re| ... |]</tt>, is equivalent to <tt>[reMultilineSensitive| ...
--   |]</tt>, compiling a case-sensitive, multi-line RE
re :: QuasiQuoter

-- | <tt>[reMultilineSensitive| ... |]</tt>, compiles a case-sensitive,
--   multi-line RE
reMultilineSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   multi-line RE
reMultilineInsensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-sensitive,
--   non-multi-line RE
reBlockSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   non-multi-line RE
reBlockInsensitive :: QuasiQuoter

-- | <tt>[reMS| ... |]</tt> is a shorthand for <tt>[reMultilineSensitive|
--   ... |]</tt>
reMS :: QuasiQuoter

-- | <tt>[reMI| ... |]</tt> is a shorthand for <tt>[reMultilineInsensitive|
--   ... |]</tt>
reMI :: QuasiQuoter

-- | <tt>[reBS| ... |]</tt> is a shorthand for <tt>[reBlockSensitive| ...
--   |]</tt>
reBS :: QuasiQuoter

-- | <tt>[reBI| ... |]</tt> is a shorthand for <tt>[reBlockInsensitive| ...
--   |]</tt>
reBI :: QuasiQuoter

-- | <tt>[re_| ... |]</tt> compiles a RE to produce a function that takes
--   the RE options (e.g., a <a>SimpleREOptions</a> value) and yields the
--   RE compiled with those options. For example,
--   
--   <pre>
--   countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive
--   </pre>
--   
--   counts the number of hexadecimal digit strings in <tt>s</tt>, allowing
--   upper- or lower-case hex didgits.
re_ :: QuasiQuoter

-- | <tt>[edMultilineSensitive| ... /// ... |]</tt> compiles a
--   case-sensitive, multi-line <a>SearchReplace</a> template
edMultilineSensitive :: QuasiQuoter

-- | <tt>[edMultilineInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, multi-line <a>SearchReplace</a> template
edMultilineInsensitive :: QuasiQuoter

-- | <tt>[edBlockSensitive| ... /// ... |]</tt> compiles a case-sensitive,
--   non-multi-line <a>SearchReplace</a> template
edBlockSensitive :: QuasiQuoter

-- | <tt>[edBlockInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, non-multi-line <a>SearchReplace</a> template
edBlockInsensitive :: QuasiQuoter

-- | <tt>[ed| ... /// ... |]</tt>, is equivalent to
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>, compiling a
--   case-sensitive, multi-line <a>SearchReplace</a>
ed :: QuasiQuoter

-- | <tt>[edMS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>
edMS :: QuasiQuoter

-- | <tt>[edMI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineInsensitive| ... /// ... |]</tt>
edMI :: QuasiQuoter

-- | <tt>[edBS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockSensitive| ... /// ... |]</tt>
edBS :: QuasiQuoter

-- | <tt>[edBI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockInsensitive| ... /// ... |]</tt>
edBI :: QuasiQuoter

-- | <tt>[ed_| ... /// ... |]</tt> compiles a <a>SearchReplace</a> template
--   to produce a function that takes the RE options (e.g., a
--   <a>SimpleREOptions</a> value) and yields the <a>SearchReplace</a>
--   template compiled with those options. For example,
--   
--   <pre>
--   s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive
--   </pre>
--   
--   prefixes the hexadecimal digit strings in s with <tt>0x</tt>, allowing
--   for upper- or lower-case hex didgits (which is entirely equivalent in
--   this example to just using
--   <tt>[edMultilineInsensitive|[0-9a-f]+|]</tt>).
ed_ :: QuasiQuoter

-- | quasi quoter for CaptureID: <tt>[cp|0|]</tt>, <tt>[cp|0|]</tt>, etc.,
--   indexing captures by classic positional numbers, and
--   <tt>[cp|foo|]</tt>, etc., referencing a named capture <tt>[re| ...
--   ${foo}( ... ) ... |]</tt>.
cp :: QuasiQuoter
instance Text.RE.ZeInternals.Types.IsRegex.IsRegex Text.RE.ZeInternals.PCRE.RE Data.ByteString.Lazy.Internal.ByteString

module Text.RE.PCRE.ByteString

-- | find all the matches in the argument text; e.g., to count the number
--   of naturals in s:
--   
--   <pre>
--   countMatches $ s *=~ [re|[0-9]+|]
--   </pre>
(*=~) :: ByteString -> RE -> Matches ByteString

-- | find the first match in the argument text; e.g., to test if there is a
--   natural number in the input text:
--   
--   <pre>
--   matched $ s ?=~ [re|[0-9]+|]
--   </pre>
(?=~) :: ByteString -> RE -> Match ByteString

-- | search and replace all matches in the argument text; e.g., this
--   section will convert every YYYY-MM-DD format date in its argument text
--   into a DD/MM/YYYY date:
--   
--   <pre>
--   (*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])
--   </pre>
(*=~/) :: ByteString -> SearchReplace RE ByteString -> ByteString

-- | search and replace the first occurrence only (if any) in the input
--   text e.g., to prefix the first string of four hex digits in the input
--   text, if any, with <tt>0x</tt>:
--   
--   <pre>
--   (?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])
--   </pre>
(?=~/) :: ByteString -> SearchReplace RE ByteString -> ByteString

-- | the result of matching a RE against a text (with <tt>*=~</tt>),
--   retaining the text that was matched against
data Matches a

-- | the source text being matched
matchesSource :: Matches a -> a

-- | all <a>Match</a> instances found, left to right
allMatches :: Matches a -> [Match a]

-- | tests whether the RE matched the source text at all
anyMatches :: () => Matches a -> Bool

-- | count the matches
countMatches :: () => Matches a -> Int

-- | list the texts that Matched
matches :: () => Matches a -> [a]

-- | the result of matching a RE to a text once (with <tt>?=~</tt>),
--   retaining the text that was matched against
data Match a

-- | the whole source text
matchSource :: Match a -> a

-- | tests whether the RE matched the source text at all
matched :: () => Match a -> Bool

-- | yields the text matched by the RE, Nothing if no match
matchedText :: () => Match a -> Maybe a

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

-- | extract the RE source string from the <tt>RE</tt>
reSource :: RE -> String

-- | the default API uses these simple, universal RE options, which get
--   auto-converted into the apropriate back-end <a>REOptions_</a>
data SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of a line
MultilineSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matsh the start and end of a line
MultilineInsensitive :: SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of the input
--   text
BlockSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matching the start and end of the input
--   text
BlockInsensitive :: SimpleREOptions

-- | contains a compiled RE and replacement template
data SearchReplace re s
SearchReplace :: !re -> !s -> SearchReplace re s

-- | the RE to match a string to replace
[getSearch] :: SearchReplace re s -> !re

-- | the replacement template with ${cap} used to identify a capture (by
--   number or name if one was given) and <tt>$$</tt> being used to escape
--   a single <a>$</a>
[getTemplate] :: SearchReplace re s -> !s

-- | compile a <a>String</a> into a <a>RE</a> with the default options,
--   generating an error if the RE is not well formed
compileRegex :: (Functor m, Monad m) => String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE

-- | compile a SearchReplace template generating errors if the RE or the
--   template are not well formed, all capture references being checked
compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)

-- | compile a SearchReplace template, with simple options, 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)

-- | 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:
--   
--   <pre>
--   maybe undefined id . escape (("^"++) . (++"$"))
--   </pre>
escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE

-- | a variant of <a>escape</a> where the <a>SimpleREOptions</a> are
--   specified
escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE

-- | Convert a string into a regular expression that will match that string
escapeREString :: String -> String

-- | the `regex-base` polymorphic match operator
(=~) :: (Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> a

-- | the `regex-base` monadic, polymorphic match operator
(=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a

-- | <tt>[re| ... |]</tt>, is equivalent to <tt>[reMultilineSensitive| ...
--   |]</tt>, compiling a case-sensitive, multi-line RE
re :: QuasiQuoter

-- | <tt>[reMultilineSensitive| ... |]</tt>, compiles a case-sensitive,
--   multi-line RE
reMultilineSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   multi-line RE
reMultilineInsensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-sensitive,
--   non-multi-line RE
reBlockSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   non-multi-line RE
reBlockInsensitive :: QuasiQuoter

-- | <tt>[reMS| ... |]</tt> is a shorthand for <tt>[reMultilineSensitive|
--   ... |]</tt>
reMS :: QuasiQuoter

-- | <tt>[reMI| ... |]</tt> is a shorthand for <tt>[reMultilineInsensitive|
--   ... |]</tt>
reMI :: QuasiQuoter

-- | <tt>[reBS| ... |]</tt> is a shorthand for <tt>[reBlockSensitive| ...
--   |]</tt>
reBS :: QuasiQuoter

-- | <tt>[reBI| ... |]</tt> is a shorthand for <tt>[reBlockInsensitive| ...
--   |]</tt>
reBI :: QuasiQuoter

-- | <tt>[re_| ... |]</tt> compiles a RE to produce a function that takes
--   the RE options (e.g., a <a>SimpleREOptions</a> value) and yields the
--   RE compiled with those options. For example,
--   
--   <pre>
--   countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive
--   </pre>
--   
--   counts the number of hexadecimal digit strings in <tt>s</tt>, allowing
--   upper- or lower-case hex didgits.
re_ :: QuasiQuoter

-- | <tt>[edMultilineSensitive| ... /// ... |]</tt> compiles a
--   case-sensitive, multi-line <a>SearchReplace</a> template
edMultilineSensitive :: QuasiQuoter

-- | <tt>[edMultilineInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, multi-line <a>SearchReplace</a> template
edMultilineInsensitive :: QuasiQuoter

-- | <tt>[edBlockSensitive| ... /// ... |]</tt> compiles a case-sensitive,
--   non-multi-line <a>SearchReplace</a> template
edBlockSensitive :: QuasiQuoter

-- | <tt>[edBlockInsensitive| ... /// ... |]</tt> compiles a
--   case-insensitive, non-multi-line <a>SearchReplace</a> template
edBlockInsensitive :: QuasiQuoter

-- | <tt>[ed| ... /// ... |]</tt>, is equivalent to
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>, compiling a
--   case-sensitive, multi-line <a>SearchReplace</a>
ed :: QuasiQuoter

-- | <tt>[edMS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineSensitive| ... /// ... |]</tt>
edMS :: QuasiQuoter

-- | <tt>[edMI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edMultilineInsensitive| ... /// ... |]</tt>
edMI :: QuasiQuoter

-- | <tt>[edBS| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockSensitive| ... /// ... |]</tt>
edBS :: QuasiQuoter

-- | <tt>[edBI| ... /// ... |]</tt> is a shorthand for
--   <tt>[edBlockInsensitive| ... /// ... |]</tt>
edBI :: QuasiQuoter

-- | <tt>[ed_| ... /// ... |]</tt> compiles a <a>SearchReplace</a> template
--   to produce a function that takes the RE options (e.g., a
--   <a>SimpleREOptions</a> value) and yields the <a>SearchReplace</a>
--   template compiled with those options. For example,
--   
--   <pre>
--   s *=~/ [ed_|${hex}([0-9a-f]+)///0x${hex}|] MultilineInsensitive
--   </pre>
--   
--   prefixes the hexadecimal digit strings in s with <tt>0x</tt>, allowing
--   for upper- or lower-case hex didgits (which is entirely equivalent in
--   this example to just using
--   <tt>[edMultilineInsensitive|[0-9a-f]+|]</tt>).
ed_ :: QuasiQuoter

-- | quasi quoter for CaptureID: <tt>[cp|0|]</tt>, <tt>[cp|0|]</tt>, etc.,
--   indexing captures by classic positional numbers, and
--   <tt>[cp|foo|]</tt>, etc., referencing a named capture <tt>[re| ...
--   ${foo}( ... ) ... |]</tt>.
cp :: QuasiQuoter
instance Text.RE.ZeInternals.Types.IsRegex.IsRegex Text.RE.ZeInternals.PCRE.RE Data.ByteString.Internal.ByteString

module Text.RE.PCRE

-- | find all the matches in the argument text; e.g., to count the number
--   of naturals in s:
--   
--   <pre>
--   countMatches $ s *=~ [re|[0-9]+|]
--   </pre>
(*=~) :: IsRegex RE s => s -> RE -> Matches s

-- | find the first match in the argument text; e.g., to test if there is a
--   natural number in the input text:
--   
--   <pre>
--   matched $ s ?=~ [re|[0-9]+|]
--   </pre>
(?=~) :: IsRegex RE s => s -> RE -> Match s

-- | search and replace all matches in the argument text; e.g., this
--   section will convert every YYYY-MM-DD format date in its argument text
--   into a DD/MM/YYYY date:
--   
--   <pre>
--   (*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])
--   </pre>
(*=~/) :: IsRegex RE s => s -> SearchReplace RE s -> s

-- | search and replace the first occurrence only (if any) in the input
--   text e.g., to prefix the first string of four hex digits in the imput
--   text, if any, with <tt>0x</tt>:
--   
--   @(?=~/ [ed|[0-9A-Fa-f]{4}///0x$0|])
(?=~/) :: IsRegex RE s => s -> SearchReplace RE s -> s

-- | the result of matching a RE against a text (with <tt>*=~</tt>),
--   retaining the text that was matched against
data Matches a

-- | the source text being matched
matchesSource :: Matches a -> a

-- | all <a>Match</a> instances found, left to right
allMatches :: Matches a -> [Match a]

-- | tests whether the RE matched the source text at all
anyMatches :: () => Matches a -> Bool

-- | count the matches
countMatches :: () => Matches a -> Int

-- | list the texts that Matched
matches :: () => Matches a -> [a]

-- | the result of matching a RE to a text once (with <tt>?=~</tt>),
--   retaining the text that was matched against
data Match a

-- | the whole source text
matchSource :: Match a -> a

-- | tests whether the RE matched the source text at all
matched :: () => Match a -> Bool

-- | yields the text matched by the RE, Nothing if no match
matchedText :: () => Match a -> Maybe a

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

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

-- | extract the <a>REOptions</a> from the <tt>RE</tt>
reOptions :: RE -> REOptions

-- | extract the RE source string from the <tt>RE</tt>
reSource :: RE -> String

-- | extract the <a>CaptureNames</a> from the <tt>RE</tt>
reCaptureNames :: RE -> CaptureNames

-- | extract the back end compiled <a>Regex</a> type from the <tt>RE</tt>
reRegex :: RE -> Regex

-- | the default API uses these simple, universal RE options, which get
--   auto-converted into the apropriate back-end <a>REOptions_</a>
data SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of a line
MultilineSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matsh the start and end of a line
MultilineInsensitive :: SimpleREOptions

-- | case-sensitive with ^ and $ matching the start and end of the input
--   text
BlockSensitive :: SimpleREOptions

-- | case-insensitive with ^ and $ matching the start and end of the input
--   text
BlockInsensitive :: SimpleREOptions

-- | a number of types can be used to encode <a>REOptions_</a>, each of
--   which is made a member of this class
class IsOption o

-- | convert the <tt>o</tt> type into an <tt>REOptions</tt>
makeREOptions :: IsOption o => o -> REOptions

-- | and the REOptions for this back end (see <a>Text.RE.REOptions</a> for
--   details)
type REOptions = REOptions_ RE CompOption ExecOption

-- | the default <a>REOptions</a>
defaultREOptions :: REOptions

-- | the default <a>REOptions</a> but with no RE macros defined
noPreludeREOptions :: REOptions

-- | convert a universal <tt>SimpleReOptions</tt> into the <a>REOptions</a>
--   used by this back end
unpackSimpleREOptions :: SimpleREOptions -> REOptions

-- | contains a compiled RE and replacement template
data SearchReplace re s
SearchReplace :: !re -> !s -> SearchReplace re s

-- | the RE to match a string to replace
[getSearch] :: SearchReplace re s -> !re

-- | the replacement template with ${cap} used to identify a capture (by
--   number or name if one was given) and <tt>$$</tt> being used to escape
--   a single <a>$</a>
[getTemplate] :: SearchReplace re s -> !s

-- | compile a <a>String</a> into a <a>RE</a> with the default options,
--   generating an error if the RE is not well formed
compileRegex :: (Functor m, Monad m) => String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE

-- | compile a <a>String</a> into a <a>RE</a> using the given
--   <tt>SimpleREOptions</tt>, generating an error if the RE is not well
--   formed
compileRegexWithOptions :: (IsOption o, Functor m, Monad m) => o -> String -> m RE

-- | compile a SearchReplace template generating errors if the RE or the
--   template are not well formed, all capture references being checked
compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)

-- | compile a SearchReplace template, with simple options, 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)

-- | compile a SearchReplace template, with general options, generating
--   errors if the RE or the template are not well formed, all capture
--   references being checked
compileSearchReplaceWithOptions :: (Monad m, Functor m, IsRegex RE s) => REOptions -> String -> String -> m (SearchReplace RE s)

-- | 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:
--   
--   <pre>
--   maybe undefined id . escape (("^"++) . (++"$"))
--   </pre>
escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE

-- | a variant of <a>escape</a> where the <a>SimpleREOptions</a> are
--   specified
escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE

-- | a variant of <a>escapeWith</a> that allows an <a>IsOption</a> RE
--   option to be specified
escapeWithOptions :: (IsOption o, Functor m, Monad m) => o -> (String -> String) -> String -> m RE

-- | Convert a string into a regular expression that will match that string
escapeREString :: String -> String

-- | the regex-base polymorphic match operator
(=~) :: (RegexContext Regex s a, RegexMaker Regex CompOption ExecOption s) => s -> RE -> a

-- | the regex-base monadic, polymorphic match operator
(=~~) :: (Monad m, RegexContext Regex s a, RegexMaker Regex CompOption ExecOption s) => s -> RE -> m a

-- | <tt>[re| ... |]</tt>, is equivalent to <tt>[reMultilineSensitive| ...
--   |]</tt>, compiling a case-sensitive, multi-line RE
re :: QuasiQuoter

-- | <tt>[reMultilineSensitive| ... |]</tt>, compiles a case-sensitive,
--   multi-line RE
reMultilineSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   multi-line RE
reMultilineInsensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-sensitive,
--   non-multi-line RE
reBlockSensitive :: QuasiQuoter

-- | <tt>[reMultilineInsensitive| ... |]</tt>, compiles a case-insensitive,
--   non-multi-line RE
reBlockInsensitive :: QuasiQuoter

-- | <tt>[reMS| ... |]</tt> is a shorthand for <tt>[reMultilineSensitive|
--   ... |]</tt>
reMS :: QuasiQuoter

-- | <tt>[reMI| ... |]</tt> is a shorthand for <tt>[reMultilineInsensitive|
--   ... |]</tt>
reMI :: QuasiQuoter

-- | <tt>[reBS| ... |]</tt> is a shorthand for <tt>[reBlockSensitive| ...
--   |]</tt>
reBS :: QuasiQuoter

-- | <tt>[reBI| ... |]</tt> is a shorthand for <tt>[reBlockInsensitive| ...
--   |]</tt>
reBI :: QuasiQuoter

-- | <tt>[re_| ... |]</tt> compiles a RE to produce a function that takes
--   the RE options (e.g., a <a>SimpleREOptions</a> value) and yields the
--   RE compiled with those options. For example,
--   
--   <pre>
--   countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive
--   </pre>
--   
--   counts the number of hexadecimal digit strings in <tt>s</tt>, allowing
--   upper- or lower-case hex didgits.
re_ :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
ed :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edMultilineSensitive :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edMultilineInsensitive :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edBlockSensitive :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edBlockInsensitive :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edMS :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edMI :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edBS :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
edBI :: QuasiQuoter

-- | the <tt>[ed| ... /// ... |]</tt> quasi quoters
ed_ :: QuasiQuoter

-- | quasi quoter for CaptureID: <tt>[cp|0|]</tt>, <tt>[cp|0|]</tt>, etc.,
--   indexing captures by classic positional numbers, and
--   <tt>[cp|foo|]</tt>, etc., referencing a named capture <tt>[re| ...
--   ${foo}( ... ) ... |]</tt>.
cp :: QuasiQuoter

-- | the standard table of <a>Macros</a> used to compile REs (which can be
--   extended or replace: see <a>Text.RE.TestBench</a>)
prelude :: Macros RE

-- | the standard <a>MacroEnv</a> for this back end (see
--   <a>Text.RE.TestBench</a>)
preludeEnv :: MacroEnv

-- | the macros in the standard environment that are failing their tests
--   (checked by the test suite to be empty)
preludeTestsFailing :: [MacroID]

-- | a table the standard macros in markdown format
preludeTable :: String

-- | a summary of the macros in the standard environment for this back end
--   in plain text
preludeSummary :: PreludeMacro -> String

-- | a listing of the RE text for each macro in the standard environment
--   with all macros expanded to normal form
preludeSources :: String

-- | the prolude source of a given macro in the standard environment
preludeSource :: PreludeMacro -> String
