| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Regex.PCRE.Text
Contents
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
| RegexLike Regex Text # | |
Defined in Text.Regex.PCRE.Text.Lazy | |
| RegexLike Regex Text # | |
Defined in Text.Regex.PCRE.Text | |
| RegexOptions Regex CompOption ExecOption | |
Defined in Text.Regex.PCRE.Wrap Methods defaultCompOpt :: CompOption # defaultExecOpt :: ExecOption # setExecOpts :: ExecOption -> Regex -> Regex # getExecOpts :: Regex -> ExecOption # | |
| RegexContext Regex Text Text # | |
| RegexContext Regex Text Text # | |
| RegexMaker Regex CompOption ExecOption Text # | |
Defined in Text.Regex.PCRE.Text.Lazy Methods makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex # makeRegexM :: Monad m => Text -> m Regex # makeRegexOptsM :: Monad m => CompOption -> ExecOption -> Text -> m Regex # | |
| RegexMaker Regex CompOption ExecOption Text # | |
Defined in Text.Regex.PCRE.Text Methods makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex # makeRegexM :: Monad m => Text -> m Regex # makeRegexOptsM :: Monad m => CompOption -> ExecOption -> Text -> m Regex # | |
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 #
Constructors
| CompOption CInt |
Instances
newtype ExecOption #
Constructors
| ExecOption CInt |
Instances
data ReturnCode #
Instances
| Eq ReturnCode | |
Defined in Text.Regex.PCRE.Wrap | |
| Show ReturnCode | |
Defined in Text.Regex.PCRE.Wrap Methods showsPrec :: Int -> ReturnCode -> ShowS # show :: ReturnCode -> String # showList :: [ReturnCode] -> ShowS # | |
type WrapError = (ReturnCode, String) #
Miscellaneous
getVersion :: Maybe String #
return version of pcre used or Nothing if pcre is not available.
Medium level API functions
Arguments
| :: 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
Arguments
| :: 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
Arguments
| :: 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
compBlank :: CompOption #
compExtra :: CompOption #
compUTF8 :: CompOption #
ExecOption flags
execBlank :: ExecOption #
Orphan instances
| RegexLike Regex Text # | |
| RegexContext Regex Text Text # | |
| RegexMaker Regex CompOption ExecOption Text # | |
Methods makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex # makeRegexM :: Monad m => Text -> m Regex # makeRegexOptsM :: Monad m => CompOption -> ExecOption -> Text -> m Regex # | |