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 -> ByteString -> IO (Either (MatchOffset, String) Regex)
- 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
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) |
-> ByteString | The regular expression to compile |
-> IO (Either (MatchOffset, String) Regex) | Returns: the compiled regular expression |
Compiles a regular expression
:: Regex | Compiled regular expression |
-> ByteString | String to match against |
-> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength)))) | Returns: |
Matches a regular expression against a buffer, returning the buffer indicies of the match, and any submatches
| Matches a regular expression against a string
:: Regex | Compiled regular expression |
-> ByteString | String to match against |
-> IO (Either WrapError (Maybe (ByteString, ByteString, ByteString, [ByteString]))) |
CompOption flags
ExecOption flags
Orphan instances
RegexLike Regex ByteString Source # | |
matchOnce :: Regex -> ByteString -> Maybe MatchArray # matchAll :: Regex -> ByteString -> [MatchArray] # matchCount :: Regex -> ByteString -> Int # matchTest :: Regex -> ByteString -> Bool # matchAllText :: Regex -> ByteString -> [MatchText ByteString] # matchOnceText :: Regex -> ByteString -> Maybe (ByteString, MatchText ByteString, ByteString) # | |
RegexContext Regex ByteString ByteString Source # | |
match :: Regex -> ByteString -> ByteString # matchM :: MonadFail m => Regex -> ByteString -> m ByteString # | |
RegexMaker Regex CompOption ExecOption ByteString Source # | |
makeRegex :: ByteString -> Regex # makeRegexOpts :: CompOption -> ExecOption -> ByteString -> Regex # makeRegexM :: MonadFail m => ByteString -> m Regex # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> ByteString -> m Regex # |