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


-- | Replaces/Enhances Text.Regex
--   
--   The PCRE backend to accompany regex-base, see www.pcre.org
@package regex-pcre
@version 0.94.4


-- | This will fail or error only if allocation fails or a nullPtr is
--   passed in.
module Text.Regex.PCRE.Wrap

-- | A compiled regular expression
data Regex
newtype CompOption
CompOption :: CInt -> CompOption
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, Monad m) => source1 -> source -> m target
type StartOffset = MatchOffset
type EndOffset = MatchOffset
newtype ReturnCode
ReturnCode :: CInt -> ReturnCode
type WrapError = (ReturnCode, String)

-- | Compiles a regular expression
wrapCompile :: CompOption -> ExecOption -> CString -> IO (Either (MatchOffset, String) Regex)
wrapTest :: StartOffset -> Regex -> CStringLen -> IO (Either WrapError Bool)

-- | Matches a regular expression against a string
--   
--   Should never return (Right (Just []))
wrapMatch :: StartOffset -> Regex -> CStringLen -> IO (Either WrapError (Maybe [(StartOffset, EndOffset)]))

-- | wrapMatchAll is an improvement over wrapMatch since it only allocates
--   memory with allocaBytes once at the start.
wrapMatchAll :: Regex -> CStringLen -> IO (Either WrapError [MatchArray])
wrapCount :: Regex -> CStringLen -> IO (Either WrapError Int)

-- | return version of pcre used or Nothing if pcre is not available.
getVersion :: Maybe String
configUTF8 :: Bool
getNumSubs :: Regex -> Int
unusedOffset :: MatchOffset
compBlank :: CompOption
compAnchored :: CompOption
compAutoCallout :: CompOption
compCaseless :: CompOption
compDollarEndOnly :: CompOption
compDotAll :: CompOption
compExtended :: CompOption
compExtra :: CompOption
compFirstLine :: CompOption
compMultiline :: CompOption
compNoAutoCapture :: CompOption
compUngreedy :: CompOption
compUTF8 :: CompOption
compNoUTF8Check :: CompOption
execBlank :: ExecOption
execAnchored :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
execNotEmpty :: ExecOption
execNoUTF8Check :: ExecOption
execPartial :: ExecOption
retOk :: ReturnCode
retNoMatch :: ReturnCode
retNull :: ReturnCode
retBadOption :: ReturnCode
retBadMagic :: ReturnCode
retUnknownNode :: ReturnCode
retNoMemory :: ReturnCode
retNoSubstring :: ReturnCode
instance GHC.Show.Show Text.Regex.PCRE.Wrap.ConfigWhat
instance GHC.Classes.Eq Text.Regex.PCRE.Wrap.ConfigWhat
instance GHC.Show.Show Text.Regex.PCRE.Wrap.InfoWhat
instance GHC.Classes.Eq Text.Regex.PCRE.Wrap.InfoWhat
instance GHC.Show.Show Text.Regex.PCRE.Wrap.ReturnCode
instance GHC.Classes.Eq Text.Regex.PCRE.Wrap.ReturnCode
instance Data.Bits.Bits Text.Regex.PCRE.Wrap.ExecOption
instance GHC.Num.Num Text.Regex.PCRE.Wrap.ExecOption
instance GHC.Show.Show Text.Regex.PCRE.Wrap.ExecOption
instance GHC.Classes.Eq Text.Regex.PCRE.Wrap.ExecOption
instance Data.Bits.Bits Text.Regex.PCRE.Wrap.CompOption
instance GHC.Num.Num Text.Regex.PCRE.Wrap.CompOption
instance GHC.Show.Show Text.Regex.PCRE.Wrap.CompOption
instance GHC.Classes.Eq Text.Regex.PCRE.Wrap.CompOption
instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PCRE.Wrap.Regex Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption


-- | This exports instances of the high level API and the medium level API
--   of <a>compile</a>,<a>execute</a>, and <a>regexec</a>.
module Text.Regex.PCRE.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
newtype CompOption
CompOption :: CInt -> CompOption
newtype ExecOption
ExecOption :: CInt -> ExecOption
data ReturnCode
type WrapError = (ReturnCode, String)
unusedOffset :: MatchOffset

-- | return version of pcre used or Nothing if pcre is not available.
getVersion :: Maybe String

-- | Compiles a regular expression
compile :: CompOption -> ExecOption -> String -> IO (Either (MatchOffset, String) Regex)

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

-- | execute match and extract substrings rather than just offsets
regexec :: Regex -> String -> IO (Either WrapError (Maybe (String, String, String, [String])))
compBlank :: CompOption
compAnchored :: CompOption
compAutoCallout :: CompOption
compCaseless :: CompOption
compDollarEndOnly :: CompOption
compDotAll :: CompOption
compExtended :: CompOption
compExtra :: CompOption
compFirstLine :: CompOption
compMultiline :: CompOption
compNoAutoCapture :: CompOption
compUngreedy :: CompOption
compUTF8 :: CompOption
compNoUTF8Check :: CompOption
execBlank :: ExecOption
execAnchored :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
execNotEmpty :: ExecOption
execNoUTF8Check :: ExecOption
execPartial :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.PCRE.Wrap.Regex GHC.Base.String GHC.Base.String
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.PCRE.Wrap.Regex Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption GHC.Base.String
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.PCRE.Wrap.Regex GHC.Base.String


-- | This exports instances of the high level API and the medium level API
--   of <a>compile</a>,<a>execute</a>, and <a>regexec</a>.
module Text.Regex.PCRE.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
newtype CompOption
CompOption :: CInt -> CompOption
newtype ExecOption
ExecOption :: CInt -> ExecOption
data ReturnCode
type WrapError = (ReturnCode, String)
unusedOffset :: MatchOffset

-- | return version of pcre used or Nothing if pcre is not available.
getVersion :: Maybe String

-- | Compiles a regular expression
compile :: CompOption -> ExecOption -> (Seq Char) -> IO (Either (MatchOffset, String) Regex)

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

-- | execute match and extract substrings rather than just offsets
regexec :: Regex -> (Seq Char) -> IO (Either WrapError (Maybe (Seq Char, Seq Char, Seq Char, [(Seq Char)])))
compBlank :: CompOption
compAnchored :: CompOption
compAutoCallout :: CompOption
compCaseless :: CompOption
compDollarEndOnly :: CompOption
compDotAll :: CompOption
compExtended :: CompOption
compExtra :: CompOption
compFirstLine :: CompOption
compMultiline :: CompOption
compNoAutoCapture :: CompOption
compUngreedy :: CompOption
compUTF8 :: CompOption
compNoUTF8Check :: CompOption
execBlank :: ExecOption
execAnchored :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
execNotEmpty :: ExecOption
execNoUTF8Check :: ExecOption
execPartial :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.PCRE.Wrap.Regex (Data.Sequence.Seq GHC.Types.Char) (Data.Sequence.Seq GHC.Types.Char)
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.PCRE.Wrap.Regex Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption (Data.Sequence.Seq GHC.Types.Char)
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.PCRE.Wrap.Regex (Data.Sequence.Seq GHC.Types.Char)


-- | This exports instances of the high level API and the medium level API
--   of <a>compile</a>,<a>execute</a>, and <a>regexec</a>.
module Text.Regex.PCRE.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
newtype CompOption
CompOption :: CInt -> CompOption
newtype ExecOption
ExecOption :: CInt -> ExecOption
data ReturnCode
type WrapError = (ReturnCode, String)
unusedOffset :: MatchOffset

-- | return version of pcre used or Nothing if pcre is not available.
getVersion :: Maybe String

-- | Compiles a regular expression
compile :: CompOption -> ExecOption -> ByteString -> IO (Either (MatchOffset, String) 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])))
compBlank :: CompOption
compAnchored :: CompOption
compAutoCallout :: CompOption
compCaseless :: CompOption
compDollarEndOnly :: CompOption
compDotAll :: CompOption
compExtended :: CompOption
compExtra :: CompOption
compFirstLine :: CompOption
compMultiline :: CompOption
compNoAutoCapture :: CompOption
compUngreedy :: CompOption
compUTF8 :: CompOption
compNoUTF8Check :: CompOption
execBlank :: ExecOption
execAnchored :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
execNotEmpty :: ExecOption
execNoUTF8Check :: ExecOption
execPartial :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.PCRE.Wrap.Regex Data.ByteString.Internal.ByteString Data.ByteString.Internal.ByteString
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.PCRE.Wrap.Regex Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption Data.ByteString.Internal.ByteString
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.PCRE.Wrap.Regex Data.ByteString.Internal.ByteString


-- | This exports instances of the high level API and the medium level API
--   of <a>compile</a>,<a>execute</a>, and <a>regexec</a>.
module Text.Regex.PCRE.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
newtype CompOption
CompOption :: CInt -> CompOption
newtype ExecOption
ExecOption :: CInt -> ExecOption
data ReturnCode
type WrapError = (ReturnCode, String)
unusedOffset :: MatchOffset

-- | return version of pcre used or Nothing if pcre is not available.
getVersion :: Maybe String

-- | Compiles a regular expression
compile :: CompOption -> ExecOption -> ByteString -> IO (Either (MatchOffset, String) 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])))
compBlank :: CompOption
compAnchored :: CompOption
compAutoCallout :: CompOption
compCaseless :: CompOption
compDollarEndOnly :: CompOption
compDotAll :: CompOption
compExtended :: CompOption
compExtra :: CompOption
compFirstLine :: CompOption
compMultiline :: CompOption
compNoAutoCapture :: CompOption
compUngreedy :: CompOption
compUTF8 :: CompOption
compNoUTF8Check :: CompOption
execBlank :: ExecOption
execAnchored :: ExecOption
execNotBOL :: ExecOption
execNotEOL :: ExecOption
execNotEmpty :: ExecOption
execNoUTF8Check :: ExecOption
execPartial :: ExecOption
instance Text.Regex.Base.RegexLike.RegexContext Text.Regex.PCRE.Wrap.Regex Data.ByteString.Lazy.Internal.ByteString Data.ByteString.Lazy.Internal.ByteString
instance Text.Regex.Base.RegexLike.RegexMaker Text.Regex.PCRE.Wrap.Regex Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption Data.ByteString.Lazy.Internal.ByteString
instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.PCRE.Wrap.Regex Data.ByteString.Lazy.Internal.ByteString


-- | The <a>Text.Regex.PCRE</a> 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.
--   
--   You will need to have libpcre, from www.pcre.org, to use this module.
--   The haskell must be compiled with -DHAVE_PCRE_H and linked with pcre.
--   This is the default in the cabal file.
--   
--   If you do not compile with HAVE_PCRE_H then the functions will still
--   exist, but using them will create a run time error. You can test for
--   the existance of PCRE by checking <a>getVersion</a> which is
--   <a>Nothing</a> if not compiled with PCRE or <a>Just</a> <a>String</a>
--   if PCRE is present.
--   
--   Using the provided <a>CompOption</a> and <a>ExecOption</a> values and
--   if <a>configUTF8</a> is True, then you might be able to send UTF8
--   encoded ByteStrings to PCRE and get sensible results. This is
--   currently untested.
--   
--   The regular expression can be provided as a <tt>ByteString</tt>, but
--   it will be copied and a NUL byte appended to make a <tt>CString</tt>
--   unless such a byte is already present. Thus the regular expression
--   cannot contain an explicit NUL byte. The search string is passed as a
--   <tt>CStringLen</tt> and may contain NUL bytes and does not need to end
--   in a NUL byte. <tt>ByteString</tt>s are searched in place (via
--   unsafeUseAsCStringLen).
--   
--   A <a>String</a> will be converted into a <tt>CString</tt> or
--   <tt>CStringLen</tt> for processing. Doing this repeatedly will be very
--   inefficient.
--   
--   The <a>Text.Regex.PCRE.String</a>, <a>Text.Regex.PCRE.ByteString</a>,
--   and <a>Text.Regex.PCRE.Wrap</a> modules provides both the high level
--   interface exported by this module and medium- and low-level interfaces
--   that returns error using Either structures.
module Text.Regex.PCRE
getVersion_Text_Regex_PCRE :: Version
