Copyright | (c) 2006-2017 Chris Dornan and Christopher Kuklewicz |
---|---|
License | BSD-3-Clause |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Regex
- type MatchOffset = Int
- type MatchLength = Int
- newtype CompOption = CompOption CInt
- newtype ExecOption = ExecOption CInt
- data ReturnCode
- type WrapError = (ReturnCode, String)
- unusedOffset :: MatchOffset
- getVersion :: Maybe String
- compile :: CompOption -> ExecOption -> Text -> IO (Either (MatchOffset, String) Regex)
- execute :: Regex -> Text -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
- regexec :: Regex -> Text -> IO (Either WrapError (Maybe (Text, Text, Text, [Text])))
- 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
Types
A compiled regular expression
Instances
type MatchOffset = Int #
0 based index from start of source, or (-1) for unused
type MatchLength = Int #
non-negative length of a match
newtype CompOption Source #
Instances
newtype ExecOption Source #
Instances
data ReturnCode Source #
Instances
Eq ReturnCode Source # | |
Defined in Text.Regex.PCRE.Wrap (==) :: ReturnCode -> ReturnCode -> Bool # (/=) :: ReturnCode -> ReturnCode -> Bool # | |
Show ReturnCode Source # | |
Defined in Text.Regex.PCRE.Wrap showsPrec :: Int -> ReturnCode -> ShowS # show :: ReturnCode -> String # showList :: [ReturnCode] -> ShowS # |
type WrapError = (ReturnCode, String) Source #
Miscellaneous
getVersion :: Maybe String Source #
Version string of PCRE library
NOTE: The Maybe
type is used for historic reasons; practically, getVersion
is never Nothing
.
Medium level API functions
:: CompOption | (summed together) |
-> ExecOption | (summed together) |
-> Text | The regular expression to compile |
-> IO (Either (MatchOffset, String) Regex) | Returns: the compiled regular expression |
Compiles a regular expression
:: Regex | Compiled regular expression |
-> Text | Text to match against |
-> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength)))) | Returns: |
Matches a regular expression against a string
:: Regex | Compiled regular expression |
-> Text | Text to match against |
-> IO (Either WrapError (Maybe (Text, Text, Text, [Text]))) | Returns: |
Matches a regular expression against a string
CompOption flags
ExecOption flags
Orphan instances
RegexLike Regex Text Source # | |
RegexContext Regex Text Text Source # | |
RegexMaker Regex CompOption ExecOption Text Source # | |
makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex # makeRegexM :: MonadFail m => Text -> m Regex # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex # |