Safe Haskell | None |
---|
- 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 -> Seq Char -> IO (Either (MatchOffset, String) Regex)
- execute :: Regex -> Seq Char -> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
- 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
Types
A compiled regular expression
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
newtype ExecOption Source
type WrapError = (ReturnCode, String)Source
Miscellaneous
getVersion :: Maybe StringSource
return version of pcre used or Nothing if pcre is not available.
Medium level API functions
:: CompOption | Flags (summed together) |
-> ExecOption | Flags (summed together) |
-> Seq Char | The regular expression to compile |
-> IO (Either (MatchOffset, String) Regex) | Returns: an error string and offset or the compiled regular expression |
Compiles a regular expression
:: Regex | Compiled regular expression |
-> Seq Char | (Seq Char) to match against |
-> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength)))) | Returns: |
Matches a regular expression against a string
:: Regex | compiled regular expression |
-> Seq Char | string to match |
-> IO (Either WrapError (Maybe (Seq Char, Seq Char, Seq Char, [Seq Char]))) | Returns: Nothing if no match, else (text before match, text after match, array of matches with 0 being the whole match) |
execute match and extract substrings rather than just offsets