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

-- | POSIX Backend for "Text.Regex" (regex-base)
--   
--   The POSIX regex backend for regex-base.
--   
--   The main appeal of this backend is that it's very lightweight due to
--   its reliance on the ubiquitous POSIX.2 regex facility that is
--   provided by the standard C library on most POSIX platforms.
--   
--   See also https://wiki.haskell.org/Regular_expressions for more
--   information.
@package regex-posix
@version 0.96.0.2

-- | WrapPosix.hsc exports a wrapped version of the ffi imports. To
--   increase type safety, the flags are newtype'd. The other important
--   export is a Regex type that is specific to the Posix library
--   backend. The flags are documented in Text.Regex.Posix. The
--   defaultCompOpt is (compExtended .|. compNewline).
--   
--   The Regex, CompOption, and ExecOption types and
--   their RegexOptions instance is declared. The =~ and
--   =~~ convenience functions are defined.
--   
--   This module will fail or error only if allocation fails or a nullPtr
--   is passed in.
--   
--   2009-January : wrapMatchAll and wrapCount now adjust the
--   execution option execNotBOL after the first result to take into
--   account 'n' in the text immediately before the next matches. (version
--   0.93.3)
--   
--   2009-January : wrapMatchAll and wrapCount have been
--   changed to return all non-overlapping matches, including empty matches
--   even if they coincide with the end of the previous non-empty match.
--   The change is that the first non-empty match no longer terminates the
--   search. One can filter the results to obtain the old behavior or to
--   obtain the behavior of "sed", where "sed" eliminates the empty matches
--   which coincide with the end of non-empty matches. (version 0.94.0)
module Text.Regex.Posix.Wrap

-- | A compiled regular expression.
data Regex

-- | RegOffset is typedef int regoff_t on Linux and
--   ultimately typedef long long __int64_t on Max OS X. So rather
--   than saying 2,147,483,647 is all the length you need, I'll take the
--   larger: 9,223,372,036,854,775,807 should be enough bytes for anyone,
--   no need for Integer. The alternative is to compile to different sizes
--   in a platform dependent manner with type RegOffset = (#type
--   regoff_t), which I do not want to do.
--   
--   There is also a special value unusedRegOffset ::
--   RegOffset which is (-1) and as a starting index means that
--   the subgroup capture was unused. Otherwise the RegOffset
--   indicates a character boundary that is before the character at that
--   index offset, with the first character at index offset 0. So starting
--   at 1 and ending at 2 means to take only the second character.
type RegOffset = Int64
type RegOffsetT = Int32
(=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target
(=~~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target, MonadFail m) => source1 -> source -> m target

-- | The return code will be retOk when it is the Haskell wrapper
--   and not the underlying library generating the error message.
type WrapError = (ReturnCode, String)
wrapCompile :: CompOption -> ExecOption -> CString -> IO (Either WrapError Regex)
wrapTest :: Regex -> CString -> IO (Either WrapError Bool)

-- | wrapMatch returns offsets for the begin and end of each
--   capture. Unused captures have offsets of unusedRegOffset which
--   is (-1).
wrapMatch :: Regex -> CString -> IO (Either WrapError (Maybe [(RegOffset, RegOffset)]))

-- | wrapMatchAll returns the offset and length of each capture.
--   Unused captures have an offset of unusedRegOffset which is (-1)
--   and length of 0.
wrapMatchAll :: Regex -> CString -> IO (Either WrapError [MatchArray])
wrapCount :: Regex -> CString -> IO (Either WrapError Int)
unusedRegOffset :: RegOffset

-- | A bitmapped CInt containing options for compilation of regular
--   expressions. Option values (and their man 3 regcomp names) are
--   
--   
--   
- compBlank which is a completely zero value for all the
--   flags. This is also the blankCompOpt value.
--   
- compExtended (REG_EXTENDED) which can be set to use
--   extended instead of basic regular expressions. This is set in the
--   defaultCompOpt value.
--   
- compNewline (REG_NEWLINE) turns on newline sensitivity: The
--   dot (.) and inverted set [^ ] never match newline, and ^ and
--   $ anchors do match after and before newlines. This is set in the
--   defaultCompOpt value.
--   
- compIgnoreCase (REG_ICASE) which can be set to match
--   ignoring upper and lower distinctions.
--   
- compNoSub (REG_NOSUB) which turns off all information from
--   matching except whether a match exists.
--   
newtype CompOption
CompOption :: CInt -> CompOption

-- | A completely zero value for all the flags. This is also the
--   blankCompOpt value.
compBlank :: CompOption
compExtended :: CompOption
compIgnoreCase :: CompOption
compNoSub :: CompOption
compNewline :: CompOption

-- | A bitmapped CInt containing options for execution of compiled
--   regular expressions. Option values (and their man 3 regexec names) are
--   
--   
--   
- execBlank which is a complete zero value for all the flags.
--   This is the blankExecOpt value.
--   
- execNotBOL (REG_NOTBOL) can be set to prevent ^ from
--   matching at the start of the input.
--   
- execNotEOL (REG_NOTEOL) can be set to prevent $ from
--   matching at the end of the input (before the terminating NUL).
--   
newtype ExecOption
ExecOption :: CInt -> ExecOption

-- | A completely zero value for all the flags. This is also the
--   blankExecOpt value.
execBlank :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption

-- | ReturnCode is an enumerated CInt, corresponding to the error
--   codes from man 3 regex:
--   
--   
--   
- retBadbr (REG_BADBR) invalid repetition count(s)
--   in { }
--   
- retBadpat (REG_BADPAT) invalid regular
--   expression
--   
- retBadrpt (REG_BADRPT) ?, *, or
--   + operand invalid
--   
- retEcollate (REG_ECOLLATE) invalid collating
--   element
--   
- retEctype (REG_ECTYPE) invalid character
--   class
--   
- retEescape (REG_EESCAPE) \ applied to
--   unescapable character
--   
- retEsubreg (REG_ESUBREG) invalid backreference
--   number
--   
- retEbrack (REG_EBRACK) brackets [ ] not
--   balanced
--   
- retEparen (REG_EPAREN) parentheses ( )
--   not balanced
--   
- retEbrace (REG_EBRACE) braces { } not
--   balanced
--   
- retErange (REG_ERANGE) invalid character range in
--   [ ]
--   
- retEspace (REG_ESPACE) ran out of memory
--   
- retNoMatch (REG_NOMATCH) The regexec() function
--   failed to match
--   
newtype ReturnCode
ReturnCode :: CInt -> ReturnCode
retBadbr :: ReturnCode
retBadpat :: ReturnCode
retBadrpt :: ReturnCode
retEcollate :: ReturnCode
retEctype :: ReturnCode
retEescape :: ReturnCode
retEsubreg :: ReturnCode
retEbrack :: ReturnCode
retEparen :: ReturnCode
retEbrace :: ReturnCode
retErange :: ReturnCode
retEspace :: ReturnCode
instance GHC.Internal.Bits.Bits Text.Regex.Posix.Wrap.CompOption
instance GHC.Internal.Bits.Bits Text.Regex.Posix.Wrap.ExecOption
instance GHC.Classes.Eq Text.Regex.Posix.Wrap.CompOption
instance GHC.Classes.Eq Text.Regex.Posix.Wrap.ExecOption
instance GHC.Classes.Eq Text.Regex.Posix.Wrap.ReturnCode
instance GHC.Internal.Num.Num Text.Regex.Posix.Wrap.CompOption
instance GHC.Internal.Num.Num Text.Regex.Posix.Wrap.ExecOption
instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.Posix.Wrap.Regex Text.Regex.Posix.Wrap.CompOption Text.Regex.Posix.Wrap.ExecOption
instance GHC.Internal.Show.Show Text.Regex.Posix.Wrap.CompOption
instance GHC.Internal.Show.Show Text.Regex.Posix.Wrap.ExecOption
instance GHC.Internal.Show.Show Text.Regex.Posix.Wrap.ReturnCode

-- | This provides String instances for RegexMaker and
--   RegexLike based on Text.Regex.Posix.Wrap, and a
--   (RegexContext Regex String String)
--   instance.
--   
--   To use these instance, you would normally import
--   Text.Regex.Posix. You only need to import this module to use
--   the medium level API of the compile, regexec, and execute functions.
--   All of these report error by returning Left values instead of
--   undefined or error or fail.
module Text.Regex.Posix.String

-- | A compiled regular expression.
data Regex

-- | 0 based index from start of source, or (-1) for unused
type MatchOffset = Int

-- | non-negative length of a match
type MatchLength = Int

-- | ReturnCode is an enumerated CInt, corresponding to the error
--   codes from man 3 regex:
--   
--   
--   
- retBadbr (REG_BADBR) invalid repetition count(s)
--   in { }
--   
- retBadpat (REG_BADPAT) invalid regular
--   expression
--   
- retBadrpt (REG_BADRPT) ?, *, or
--   + operand invalid
--   
- retEcollate (REG_ECOLLATE) invalid collating
--   element
--   
- retEctype (REG_ECTYPE) invalid character
--   class
--   
- retEescape (REG_EESCAPE) \ applied to
--   unescapable character
--   
- retEsubreg (REG_ESUBREG) invalid backreference
--   number
--   
- retEbrack (REG_EBRACK) brackets [ ] not
--   balanced
--   
- retEparen (REG_EPAREN) parentheses ( )
--   not balanced
--   
- retEbrace (REG_EBRACE) braces { } not
--   balanced
--   
- retErange (REG_ERANGE) invalid character range in
--   [ ]
--   
- retEspace (REG_ESPACE) ran out of memory
--   
- retNoMatch (REG_NOMATCH) The regexec() function
--   failed to match
--   
data ReturnCode

-- | The return code will be retOk when it is the Haskell wrapper
--   and not the underlying library generating the error message.
type WrapError = (ReturnCode, String)
unusedOffset :: Int
compile :: CompOption -> ExecOption -> String -> IO (Either WrapError Regex)

-- | Matches a regular expression against a string
regexec :: Regex -> String -> IO (Either WrapError (Maybe (String, String, String, [String])))

-- | Matches a regular expression against a string
execute :: Regex -> String -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))

-- | A bitmapped CInt containing options for compilation of regular
--   expressions. Option values (and their man 3 regcomp names) are
--   
--   
--   
- compBlank which is a completely zero value for all the
--   flags. This is also the blankCompOpt value.
--   
- compExtended (REG_EXTENDED) which can be set to use
--   extended instead of basic regular expressions. This is set in the
--   defaultCompOpt value.
--   
- compNewline (REG_NEWLINE) turns on newline sensitivity: The
--   dot (.) and inverted set [^ ] never match newline, and ^ and
--   $ anchors do match after and before newlines. This is set in the
--   defaultCompOpt value.
--   
- compIgnoreCase (REG_ICASE) which can be set to match
--   ignoring upper and lower distinctions.
--   
- compNoSub (REG_NOSUB) which turns off all information from
--   matching except whether a match exists.
--   
newtype CompOption
CompOption :: CInt -> CompOption

-- | A completely zero value for all the flags. This is also the
--   blankCompOpt value.
compBlank :: CompOption
compExtended :: CompOption
compIgnoreCase :: CompOption
compNoSub :: CompOption
compNewline :: CompOption

-- | A bitmapped CInt containing options for execution of compiled
--   regular expressions. Option values (and their man 3 regexec names) are
--   
--   
--   
- execBlank which is a complete zero value for all the flags.
--   This is the blankExecOpt value.
--   
- execNotBOL (REG_NOTBOL) can be set to prevent ^ from
--   matching at the start of the input.
--   
- execNotEOL (REG_NOTEOL) can be set to prevent $ from
--   matching at the end of the input (before the terminating NUL).
--   
newtype ExecOption
ExecOption :: CInt -> ExecOption

-- | A completely zero value for all the flags. This is also the
--   blankExecOpt value.
execBlank :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.Posix.Wrap.Regex GHC.Internal.Base.String GHC.Internal.Base.String
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.Posix.Wrap.Regex GHC.Internal.Base.String
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.Posix.Wrap.Regex Text.Regex.Posix.Wrap.CompOption Text.Regex.Posix.Wrap.ExecOption GHC.Internal.Base.String

-- | This provides String instances for RegexMaker and
--   RegexLike based on Text.Regex.Posix.Wrap, and a
--   (RegexContext Regex String String)
--   instance.
--   
--   To use these instance, you would normally import
--   Text.Regex.Posix. You only need to import this module to use
--   the medium level API of the compile, regexec, and execute functions.
--   All of these report error by returning Left values instead of
--   undefined or error or fail.
module Text.Regex.Posix.Sequence

-- | A compiled regular expression.
data Regex

-- | 0 based index from start of source, or (-1) for unused
type MatchOffset = Int

-- | non-negative length of a match
type MatchLength = Int

-- | ReturnCode is an enumerated CInt, corresponding to the error
--   codes from man 3 regex:
--   
--   
--   
- retBadbr (REG_BADBR) invalid repetition count(s)
--   in { }
--   
- retBadpat (REG_BADPAT) invalid regular
--   expression
--   
- retBadrpt (REG_BADRPT) ?, *, or
--   + operand invalid
--   
- retEcollate (REG_ECOLLATE) invalid collating
--   element
--   
- retEctype (REG_ECTYPE) invalid character
--   class
--   
- retEescape (REG_EESCAPE) \ applied to
--   unescapable character
--   
- retEsubreg (REG_ESUBREG) invalid backreference
--   number
--   
- retEbrack (REG_EBRACK) brackets [ ] not
--   balanced
--   
- retEparen (REG_EPAREN) parentheses ( )
--   not balanced
--   
- retEbrace (REG_EBRACE) braces { } not
--   balanced
--   
- retErange (REG_ERANGE) invalid character range in
--   [ ]
--   
- retEspace (REG_ESPACE) ran out of memory
--   
- retNoMatch (REG_NOMATCH) The regexec() function
--   failed to match
--   
data ReturnCode

-- | The return code will be retOk when it is the Haskell wrapper
--   and not the underlying library generating the error message.
type WrapError = (ReturnCode, String)
unusedOffset :: Int
compile :: CompOption -> ExecOption -> Seq Char -> IO (Either WrapError Regex)

-- | Matches a regular expression against a string
regexec :: Regex -> Seq Char -> IO (Either WrapError (Maybe (Seq Char, Seq Char, Seq Char, [Seq Char])))

-- | Matches a regular expression against a string
execute :: Regex -> Seq Char -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))

-- | A bitmapped CInt containing options for compilation of regular
--   expressions. Option values (and their man 3 regcomp names) are
--   
--   
--   
- compBlank which is a completely zero value for all the
--   flags. This is also the blankCompOpt value.
--   
- compExtended (REG_EXTENDED) which can be set to use
--   extended instead of basic regular expressions. This is set in the
--   defaultCompOpt value.
--   
- compNewline (REG_NEWLINE) turns on newline sensitivity: The
--   dot (.) and inverted set [^ ] never match newline, and ^ and
--   $ anchors do match after and before newlines. This is set in the
--   defaultCompOpt value.
--   
- compIgnoreCase (REG_ICASE) which can be set to match
--   ignoring upper and lower distinctions.
--   
- compNoSub (REG_NOSUB) which turns off all information from
--   matching except whether a match exists.
--   
newtype CompOption
CompOption :: CInt -> CompOption

-- | A completely zero value for all the flags. This is also the
--   blankCompOpt value.
compBlank :: CompOption
compExtended :: CompOption
compIgnoreCase :: CompOption
compNoSub :: CompOption
compNewline :: CompOption

-- | A bitmapped CInt containing options for execution of compiled
--   regular expressions. Option values (and their man 3 regexec names) are
--   
--   
--   
- execBlank which is a complete zero value for all the flags.
--   This is the blankExecOpt value.
--   
- execNotBOL (REG_NOTBOL) can be set to prevent ^ from
--   matching at the start of the input.
--   
- execNotEOL (REG_NOTEOL) can be set to prevent $ from
--   matching at the end of the input (before the terminating NUL).
--   
newtype ExecOption
ExecOption :: CInt -> ExecOption

-- | A completely zero value for all the flags. This is also the
--   blankExecOpt value.
execBlank :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.Posix.Wrap.Regex (Data.Sequence.Internal.Seq GHC.Types.Char) (Data.Sequence.Internal.Seq GHC.Types.Char)
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.Posix.Wrap.Regex (Data.Sequence.Internal.Seq GHC.Types.Char)
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.Posix.Wrap.Regex Text.Regex.Posix.Wrap.CompOption Text.Regex.Posix.Wrap.ExecOption (Data.Sequence.Internal.Seq GHC.Types.Char)

-- | This provides ByteString instances for RegexMaker and RegexLike
--   based on Text.Regex.Posix.Wrap, and a (RegexContext Regex
--   ByteString ByteString) instance.
--   
--   To use these instance, you would normally import
--   Text.Regex.Posix. You only need to import this module to use
--   the medium level API of the compile, regexec, and execute functions.
--   All of these report error by returning Left values instead of
--   undefined or error or fail.
--   
--   The ByteString will only be passed to the library efficiently (as a
--   pointer) if it ends in a NUL byte. Otherwise a temporary copy must be
--   made with the 0 byte appended.
module Text.Regex.Posix.ByteString

-- | A compiled regular expression.
data Regex

-- | 0 based index from start of source, or (-1) for unused
type MatchOffset = Int

-- | non-negative length of a match
type MatchLength = Int

-- | ReturnCode is an enumerated CInt, corresponding to the error
--   codes from man 3 regex:
--   
--   
--   
- retBadbr (REG_BADBR) invalid repetition count(s)
--   in { }
--   
- retBadpat (REG_BADPAT) invalid regular
--   expression
--   
- retBadrpt (REG_BADRPT) ?, *, or
--   + operand invalid
--   
- retEcollate (REG_ECOLLATE) invalid collating
--   element
--   
- retEctype (REG_ECTYPE) invalid character
--   class
--   
- retEescape (REG_EESCAPE) \ applied to
--   unescapable character
--   
- retEsubreg (REG_ESUBREG) invalid backreference
--   number
--   
- retEbrack (REG_EBRACK) brackets [ ] not
--   balanced
--   
- retEparen (REG_EPAREN) parentheses ( )
--   not balanced
--   
- retEbrace (REG_EBRACE) braces { } not
--   balanced
--   
- retErange (REG_ERANGE) invalid character range in
--   [ ]
--   
- retEspace (REG_ESPACE) ran out of memory
--   
- retNoMatch (REG_NOMATCH) The regexec() function
--   failed to match
--   
data ReturnCode

-- | The return code will be retOk when it is the Haskell wrapper
--   and not the underlying library generating the error message.
type WrapError = (ReturnCode, String)
unusedOffset :: Int

-- | Compiles a regular expression
compile :: CompOption -> ExecOption -> ByteString -> IO (Either WrapError Regex)

-- | Matches a regular expression against a buffer, returning the buffer
--   indicies of the match, and any submatches
--   
--   | Matches a regular expression against a string
execute :: Regex -> ByteString -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
regexec :: Regex -> ByteString -> IO (Either WrapError (Maybe (ByteString, ByteString, ByteString, [ByteString])))

-- | A bitmapped CInt containing options for compilation of regular
--   expressions. Option values (and their man 3 regcomp names) are
--   
--   
--   
- compBlank which is a completely zero value for all the
--   flags. This is also the blankCompOpt value.
--   
- compExtended (REG_EXTENDED) which can be set to use
--   extended instead of basic regular expressions. This is set in the
--   defaultCompOpt value.
--   
- compNewline (REG_NEWLINE) turns on newline sensitivity: The
--   dot (.) and inverted set [^ ] never match newline, and ^ and
--   $ anchors do match after and before newlines. This is set in the
--   defaultCompOpt value.
--   
- compIgnoreCase (REG_ICASE) which can be set to match
--   ignoring upper and lower distinctions.
--   
- compNoSub (REG_NOSUB) which turns off all information from
--   matching except whether a match exists.
--   
newtype CompOption
CompOption :: CInt -> CompOption

-- | A completely zero value for all the flags. This is also the
--   blankCompOpt value.
compBlank :: CompOption
compExtended :: CompOption
compIgnoreCase :: CompOption
compNoSub :: CompOption
compNewline :: CompOption

-- | A bitmapped CInt containing options for execution of compiled
--   regular expressions. Option values (and their man 3 regexec names) are
--   
--   
--   
- execBlank which is a complete zero value for all the flags.
--   This is the blankExecOpt value.
--   
- execNotBOL (REG_NOTBOL) can be set to prevent ^ from
--   matching at the start of the input.
--   
- execNotEOL (REG_NOTEOL) can be set to prevent $ from
--   matching at the end of the input (before the terminating NUL).
--   
newtype ExecOption
ExecOption :: CInt -> ExecOption

-- | A completely zero value for all the flags. This is also the
--   blankExecOpt value.
execBlank :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.Posix.Wrap.Regex Data.ByteString.Internal.Type.ByteString Data.ByteString.Internal.Type.ByteString
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.Posix.Wrap.Regex Data.ByteString.Internal.Type.ByteString
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.Posix.Wrap.Regex Text.Regex.Posix.Wrap.CompOption Text.Regex.Posix.Wrap.ExecOption Data.ByteString.Internal.Type.ByteString

-- | This provides Lazy instances for RegexMaker and RegexLike based
--   on Text.Regex.Posix.Wrap, and a (RegexContext Regex ByteString
--   ByteString) instance.
--   
--   To use these instance, you would normally import
--   Text.Regex.Posix. You only need to import this module to use
--   the medium level API of the compile, regexec, and execute functions.
--   All of these report error by returning Left values instead of
--   undefined or error or fail.
--   
--   A Lazy ByteString with more than one chunk cannot be be passed to the
--   library efficiently (as a pointer). It will have to converted via a
--   full copy to a temporary normal bytestring (with a null byte appended
--   if necessary).
module Text.Regex.Posix.ByteString.Lazy

-- | A compiled regular expression.
data Regex

-- | 0 based index from start of source, or (-1) for unused
type MatchOffset = Int

-- | non-negative length of a match
type MatchLength = Int

-- | ReturnCode is an enumerated CInt, corresponding to the error
--   codes from man 3 regex:
--   
--   
--   
- retBadbr (REG_BADBR) invalid repetition count(s)
--   in { }
--   
- retBadpat (REG_BADPAT) invalid regular
--   expression
--   
- retBadrpt (REG_BADRPT) ?, *, or
--   + operand invalid
--   
- retEcollate (REG_ECOLLATE) invalid collating
--   element
--   
- retEctype (REG_ECTYPE) invalid character
--   class
--   
- retEescape (REG_EESCAPE) \ applied to
--   unescapable character
--   
- retEsubreg (REG_ESUBREG) invalid backreference
--   number
--   
- retEbrack (REG_EBRACK) brackets [ ] not
--   balanced
--   
- retEparen (REG_EPAREN) parentheses ( )
--   not balanced
--   
- retEbrace (REG_EBRACE) braces { } not
--   balanced
--   
- retErange (REG_ERANGE) invalid character range in
--   [ ]
--   
- retEspace (REG_ESPACE) ran out of memory
--   
- retNoMatch (REG_NOMATCH) The regexec() function
--   failed to match
--   
data ReturnCode

-- | The return code will be retOk when it is the Haskell wrapper
--   and not the underlying library generating the error message.
type WrapError = (ReturnCode, String)
unusedOffset :: Int

-- | Compiles a regular expression
compile :: CompOption -> ExecOption -> ByteString -> IO (Either WrapError Regex)

-- | Matches a regular expression against a buffer, returning the buffer
--   indicies of the match, and any submatches
--   
--   | Matches a regular expression against a string
execute :: Regex -> ByteString -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
regexec :: Regex -> ByteString -> IO (Either WrapError (Maybe (ByteString, ByteString, ByteString, [ByteString])))

-- | A bitmapped CInt containing options for compilation of regular
--   expressions. Option values (and their man 3 regcomp names) are
--   
--   
--   
- compBlank which is a completely zero value for all the
--   flags. This is also the blankCompOpt value.
--   
- compExtended (REG_EXTENDED) which can be set to use
--   extended instead of basic regular expressions. This is set in the
--   defaultCompOpt value.
--   
- compNewline (REG_NEWLINE) turns on newline sensitivity: The
--   dot (.) and inverted set [^ ] never match newline, and ^ and
--   $ anchors do match after and before newlines. This is set in the
--   defaultCompOpt value.
--   
- compIgnoreCase (REG_ICASE) which can be set to match
--   ignoring upper and lower distinctions.
--   
- compNoSub (REG_NOSUB) which turns off all information from
--   matching except whether a match exists.
--   
newtype CompOption
CompOption :: CInt -> CompOption

-- | A completely zero value for all the flags. This is also the
--   blankCompOpt value.
compBlank :: CompOption
compExtended :: CompOption
compIgnoreCase :: CompOption
compNoSub :: CompOption
compNewline :: CompOption

-- | A bitmapped CInt containing options for execution of compiled
--   regular expressions. Option values (and their man 3 regexec names) are
--   
--   
--   
- execBlank which is a complete zero value for all the flags.
--   This is the blankExecOpt value.
--   
- execNotBOL (REG_NOTBOL) can be set to prevent ^ from
--   matching at the start of the input.
--   
- execNotEOL (REG_NOTEOL) can be set to prevent $ from
--   matching at the end of the input (before the terminating NUL).
--   
newtype ExecOption
ExecOption :: CInt -> ExecOption

-- | A completely zero value for all the flags. This is also the
--   blankExecOpt value.
execBlank :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.Posix.Wrap.Regex Data.ByteString.Lazy.Internal.ByteString Data.ByteString.Lazy.Internal.ByteString
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.Posix.Wrap.Regex Data.ByteString.Lazy.Internal.ByteString
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.Posix.Wrap.Regex Text.Regex.Posix.Wrap.CompOption Text.Regex.Posix.Wrap.ExecOption Data.ByteString.Lazy.Internal.ByteString

-- | Module that provides the Regex backend that wraps the C POSIX.2
--   regex api. This is the backend being used by the
--   regex-compat package to replace Text.Regex.
--   
--   The Text.Regex.Posix module provides a backend for regular
--   expressions. If you import this along with other backends, then you
--   should do so with qualified imports, perhaps renamed for convenience.
--   
--   If the =~ and =~~ functions are too high level, you can
--   use the compile, regexec, and execute functions from importing either
--   Text.Regex.Posix.String or Text.Regex.Posix.ByteString.
--   If you want to use a low-level CString interface to the
--   library, then import Text.Regex.Posix.Wrap and use the wrap*
--   functions.
--   
--   This module is only efficient with ByteString only if it is
--   null terminated, i.e. (Bytestring.last bs)==0. Otherwise the
--   library must make a temporary copy of the ByteString and append
--   the NUL byte.
--   
--   A String will be converted into a CString for
--   processing. Doing this repeatedly will be very inefficient.
--   
--   Note that the posix library works with single byte characters, and
--   does not understand Unicode. If you need Unicode support you will have
--   to use a different backend.
--   
--   When offsets are reported for subexpression captures, a subexpression
--   that did not match anything (as opposed to matching an empty string)
--   will have its offset set to the unusedRegOffset value, which is
--   (-1).
--   
--   Benchmarking shows the default regex library on many platforms is very
--   inefficient. You might increase performace by an order of magnitude by
--   obtaining libpcre and regex-pcre or libtre
--   and regex-tre. If you do not need the captured substrings then
--   you can also get great performance from regex-dfa. If you do
--   need the capture substrings then you may be able to use
--   regex-parsec to improve performance.
module Text.Regex.Posix
getVersion_Text_Regex_Posix :: Version

-- | A compiled regular expression.
data Regex

-- | A bitmapped CInt containing options for compilation of regular
--   expressions. Option values (and their man 3 regcomp names) are
--   
--   
--   
- compBlank which is a completely zero value for all the
--   flags. This is also the blankCompOpt value.
--   
- compExtended (REG_EXTENDED) which can be set to use
--   extended instead of basic regular expressions. This is set in the
--   defaultCompOpt value.
--   
- compNewline (REG_NEWLINE) turns on newline sensitivity: The
--   dot (.) and inverted set [^ ] never match newline, and ^ and
--   $ anchors do match after and before newlines. This is set in the
--   defaultCompOpt value.
--   
- compIgnoreCase (REG_ICASE) which can be set to match
--   ignoring upper and lower distinctions.
--   
- compNoSub (REG_NOSUB) which turns off all information from
--   matching except whether a match exists.
--   
newtype CompOption
CompOption :: CInt -> CompOption

-- | A bitmapped CInt containing options for execution of compiled
--   regular expressions. Option values (and their man 3 regexec names) are
--   
--   
--   
- execBlank which is a complete zero value for all the flags.
--   This is the blankExecOpt value.
--   
- execNotBOL (REG_NOTBOL) can be set to prevent ^ from
--   matching at the start of the input.
--   
- execNotEOL (REG_NOTEOL) can be set to prevent $ from
--   matching at the end of the input (before the terminating NUL).
--   
newtype ExecOption
ExecOption :: CInt -> ExecOption
(=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target
(=~~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target, MonadFail m) => source1 -> source -> m target
unusedRegOffset :: RegOffset

-- | A completely zero value for all the flags. This is also the
--   blankCompOpt value.
compBlank :: CompOption
compExtended :: CompOption
compIgnoreCase :: CompOption
compNoSub :: CompOption
compNewline :: CompOption

-- | A completely zero value for all the flags. This is also the
--   blankExecOpt value.
execBlank :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
