regex-tdfa-1.3.2.5: Pure Haskell Tagged DFA Backend for "Text.Regex" (regex-base)

Copyright | Chris Kuklewicz 2007-2009 shelarcy 2012
License | BSD-style (see the file LICENSE)
Safe Haskell | None
Language | Haskell2010

Text.Regex.TDFA.Text

Contents

- Orphan instances

Description

This modules provides `RegexMaker` and `RegexLike` instances for using `Text` with the TDFA backend (Text.Regex.TDFA.NewDFA.Engine and Text.Regex.TDFA.NewDFA.Tester).

This exports instances of the high level API and the medium level API of `compile`,`execute`, and `regexec`.

Since: 1.3.1

Synopsis

- data Regex
- data CompOption
- data ExecOption
- compile :: CompOption -> ExecOption -> Text -> Either String Regex
- execute :: Regex -> Text -> Either String (Maybe MatchArray)
- regexec :: Regex -> Text -> Either String (Maybe (Text, Text, Text, [Text]))

# Documentation

data Regex Source #

The TDFA backend specific `Regex` type, used by this module's `RegexOptions` and `RegexMaker`.

#### Instances

Instances details

RegexLike Regex ByteString Source # |

Instance details

Defined in Text.Regex.TDFA.ByteString

Methods

matchOnce :: Regex -> ByteString -> Maybe MatchArray Source #

matchAll :: Regex -> ByteString -> [MatchArray] Source #

matchCount :: Regex -> ByteString -> Int Source #

matchTest :: Regex -> ByteString -> Bool Source #

matchAllText :: Regex -> ByteString -> [MatchText ByteString] Source #

matchOnceText :: Regex -> ByteString -> Maybe (ByteString, MatchText ByteString, ByteString) Source #

RegexLike Regex ByteString Source # |

Instance details

Defined in Text.Regex.TDFA.ByteString.Lazy

Methods

matchOnce :: Regex -> ByteString -> Maybe MatchArray Source #

matchAll :: Regex -> ByteString -> [MatchArray] Source #

matchCount :: Regex -> ByteString -> Int Source #

matchTest :: Regex -> ByteString -> Bool Source #

matchAllText :: Regex -> ByteString -> [MatchText ByteString] Source #

matchOnceText :: Regex -> ByteString -> Maybe (ByteString, MatchText ByteString, ByteString) Source #

RegexLike Regex Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text Methods matchOnce :: Regex -> Text -> Maybe MatchArray Source # matchAll :: Regex -> Text -> [MatchArray] Source # matchCount :: Regex -> Text -> Int Source # matchTest :: Regex -> Text -> Bool Source # matchAllText :: Regex -> Text -> [MatchText Text] Source # matchOnceText :: Regex -> Text -> Maybe (Text, MatchText Text, Text) Source #
RegexLike Regex Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text.Lazy Methods matchOnce :: Regex -> Text -> Maybe MatchArray Source # matchAll :: Regex -> Text -> [MatchArray] Source # matchCount :: Regex -> Text -> Int Source # matchTest :: Regex -> Text -> Bool Source # matchAllText :: Regex -> Text -> [MatchText Text] Source # matchOnceText :: Regex -> Text -> Maybe (Text, MatchText Text, Text) Source #
RegexLike Regex String Source # |

Instance details

Defined in Text.Regex.TDFA.String

Methods

matchOnce :: Regex -> String -> Maybe MatchArray Source #

matchAll :: Regex -> String -> [MatchArray] Source #

matchCount :: Regex -> String -> Int Source #

matchTest :: Regex -> String -> Bool Source #

matchAllText :: Regex -> String -> [MatchText String] Source #

matchOnceText :: Regex -> String -> Maybe (String, MatchText String, String) Source #

RegexContext Regex ByteString ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString Methods match :: Regex -> ByteString -> ByteString Source # matchM :: MonadFail m => Regex -> ByteString -> m ByteString Source #
RegexContext Regex ByteString ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString.Lazy Methods match :: Regex -> ByteString -> ByteString Source # matchM :: MonadFail m => Regex -> ByteString -> m ByteString Source #
RegexContext Regex Text Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text Methods match :: Regex -> Text -> Text Source # matchM :: MonadFail m => Regex -> Text -> m Text Source #
RegexContext Regex Text Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text.Lazy Methods match :: Regex -> Text -> Text Source # matchM :: MonadFail m => Regex -> Text -> m Text Source #
RegexContext Regex String String Source # |
Instance details Defined in Text.Regex.TDFA.String Methods match :: Regex -> String -> String Source # matchM :: MonadFail m => Regex -> String -> m String Source #
RegexOptions Regex CompOption ExecOption Source # |
Instance details Defined in Text.Regex.TDFA.Common Methods blankCompOpt :: CompOption Source # blankExecOpt :: ExecOption Source # defaultCompOpt :: CompOption Source # defaultExecOpt :: ExecOption Source # setExecOpts :: ExecOption -> Regex -> Regex Source # getExecOpts :: Regex -> ExecOption Source #
RegexMaker Regex CompOption ExecOption ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString Methods makeRegex :: ByteString -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> ByteString -> Regex Source # makeRegexM :: MonadFail m => ByteString -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> ByteString -> m Regex Source #
RegexMaker Regex CompOption ExecOption ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString.Lazy Methods makeRegex :: ByteString -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> ByteString -> Regex Source # makeRegexM :: MonadFail m => ByteString -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> ByteString -> m Regex Source #
RegexMaker Regex CompOption ExecOption Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text Methods makeRegex :: Text -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex Source # makeRegexM :: MonadFail m => Text -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex Source #
RegexMaker Regex CompOption ExecOption Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text.Lazy Methods makeRegex :: Text -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex Source # makeRegexM :: MonadFail m => Text -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex Source #
RegexMaker Regex CompOption ExecOption String Source # |
Instance details Defined in Text.Regex.TDFA.String Methods makeRegex :: String -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> String -> Regex Source # makeRegexM :: MonadFail m => String -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> String -> m Regex Source #
RegexMaker Regex CompOption ExecOption (Seq Char) Source # |
Instance details Defined in Text.Regex.TDFA.Sequence Methods makeRegex :: Seq Char -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Seq Char -> Regex Source # makeRegexM :: MonadFail m => Seq Char -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Seq Char -> m Regex Source #
RegexLike Regex (Seq Char) Source # |

Instance details

Defined in Text.Regex.TDFA.Sequence

Methods

matchOnce :: Regex -> Seq Char -> Maybe MatchArray Source #

matchAll :: Regex -> Seq Char -> [MatchArray] Source #

matchCount :: Regex -> Seq Char -> Int Source #

matchTest :: Regex -> Seq Char -> Bool Source #

matchAllText :: Regex -> Seq Char -> [MatchText (Seq Char)] Source #

matchOnceText :: Regex -> Seq Char -> Maybe (Seq Char, MatchText (Seq Char), Seq Char) Source #

RegexContext Regex (Seq Char) (Seq Char) Source # |
Instance details Defined in Text.Regex.TDFA.Sequence Methods match :: Regex -> Seq Char -> Seq Char Source # matchM :: MonadFail m => Regex -> Seq Char -> m (Seq Char) Source #

data CompOption Source #

Control whether the pattern is multiline or case-sensitive like Text.Regex and whether to capture the subgroups (\1, \2, etc). Controls enabling extra anchor syntax.

#### Instances

Instances details

Read CompOption Source # |
Instance details Defined in Text.Regex.TDFA.Common Methods readsPrec :: Int -> ReadS CompOption Source # readList :: ReadS [CompOption] Source # readPrec :: ReadPrec CompOption Source # readListPrec :: ReadPrec [CompOption] Source #
Show CompOption Source # |
Instance details Defined in Text.Regex.TDFA.Common Methods showsPrec :: Int -> CompOption -> ShowS Source # show :: CompOption -> String Source # showList :: [CompOption] -> ShowS Source #
RegexOptions Regex CompOption ExecOption Source # |
Instance details Defined in Text.Regex.TDFA.Common Methods blankCompOpt :: CompOption Source # blankExecOpt :: ExecOption Source # defaultCompOpt :: CompOption Source # defaultExecOpt :: ExecOption Source # setExecOpts :: ExecOption -> Regex -> Regex Source # getExecOpts :: Regex -> ExecOption Source #
RegexMaker Regex CompOption ExecOption ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString Methods makeRegex :: ByteString -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> ByteString -> Regex Source # makeRegexM :: MonadFail m => ByteString -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> ByteString -> m Regex Source #
RegexMaker Regex CompOption ExecOption ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString.Lazy Methods makeRegex :: ByteString -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> ByteString -> Regex Source # makeRegexM :: MonadFail m => ByteString -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> ByteString -> m Regex Source #
RegexMaker Regex CompOption ExecOption Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text Methods makeRegex :: Text -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex Source # makeRegexM :: MonadFail m => Text -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex Source #
RegexMaker Regex CompOption ExecOption Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text.Lazy Methods makeRegex :: Text -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex Source # makeRegexM :: MonadFail m => Text -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex Source #
RegexMaker Regex CompOption ExecOption String Source # |
Instance details Defined in Text.Regex.TDFA.String Methods makeRegex :: String -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> String -> Regex Source # makeRegexM :: MonadFail m => String -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> String -> m Regex Source #
RegexMaker Regex CompOption ExecOption (Seq Char) Source # |
Instance details Defined in Text.Regex.TDFA.Sequence Methods makeRegex :: Seq Char -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Seq Char -> Regex Source # makeRegexM :: MonadFail m => Seq Char -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Seq Char -> m Regex Source #

data ExecOption Source #

#### Instances

Instances details

Read ExecOption Source # |
Instance details Defined in Text.Regex.TDFA.Common Methods readsPrec :: Int -> ReadS ExecOption Source # readList :: ReadS [ExecOption] Source # readPrec :: ReadPrec ExecOption Source # readListPrec :: ReadPrec [ExecOption] Source #
Show ExecOption Source # |
Instance details Defined in Text.Regex.TDFA.Common Methods showsPrec :: Int -> ExecOption -> ShowS Source # show :: ExecOption -> String Source # showList :: [ExecOption] -> ShowS Source #
RegexOptions Regex CompOption ExecOption Source # |
Instance details Defined in Text.Regex.TDFA.Common Methods blankCompOpt :: CompOption Source # blankExecOpt :: ExecOption Source # defaultCompOpt :: CompOption Source # defaultExecOpt :: ExecOption Source # setExecOpts :: ExecOption -> Regex -> Regex Source # getExecOpts :: Regex -> ExecOption Source #
RegexMaker Regex CompOption ExecOption ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString Methods makeRegex :: ByteString -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> ByteString -> Regex Source # makeRegexM :: MonadFail m => ByteString -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> ByteString -> m Regex Source #
RegexMaker Regex CompOption ExecOption ByteString Source # |
Instance details Defined in Text.Regex.TDFA.ByteString.Lazy Methods makeRegex :: ByteString -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> ByteString -> Regex Source # makeRegexM :: MonadFail m => ByteString -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> ByteString -> m Regex Source #
RegexMaker Regex CompOption ExecOption Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text Methods makeRegex :: Text -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex Source # makeRegexM :: MonadFail m => Text -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex Source #
RegexMaker Regex CompOption ExecOption Text Source # | Since: 1.3.1
Instance details Defined in Text.Regex.TDFA.Text.Lazy Methods makeRegex :: Text -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex Source # makeRegexM :: MonadFail m => Text -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex Source #
RegexMaker Regex CompOption ExecOption String Source # |
Instance details Defined in Text.Regex.TDFA.String Methods makeRegex :: String -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> String -> Regex Source # makeRegexM :: MonadFail m => String -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> String -> m Regex Source #
RegexMaker Regex CompOption ExecOption (Seq Char) Source # |
Instance details Defined in Text.Regex.TDFA.Sequence Methods makeRegex :: Seq Char -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Seq Char -> Regex Source # makeRegexM :: MonadFail m => Seq Char -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Seq Char -> m Regex Source #

compile Source #

Arguments

:: CompOption | Flags (summed together)
-> ExecOption | Flags (summed together)
-> Text | The regular expression to compile
-> Either String Regex | Returns: the compiled regular expression

Since: 1.3.1

execute Source #

Arguments

:: Regex | Compiled regular expression
-> Text | Text to match against
-> Either String (Maybe MatchArray) |

Since: 1.3.1

regexec Source #

Arguments

:: Regex | Compiled regular expression
-> Text | Text to match against
-> Either String (Maybe (Text, Text, Text, [Text])) |

Since: 1.3.1

# Orphan instances

RegexLike Regex Text Source # | Since: 1.3.1
Instance details Methods matchOnce :: Regex -> Text -> Maybe MatchArray Source # matchAll :: Regex -> Text -> [MatchArray] Source # matchCount :: Regex -> Text -> Int Source # matchTest :: Regex -> Text -> Bool Source # matchAllText :: Regex -> Text -> [MatchText Text] Source # matchOnceText :: Regex -> Text -> Maybe (Text, MatchText Text, Text) Source #
RegexContext Regex Text Text Source # | Since: 1.3.1
Instance details Methods match :: Regex -> Text -> Text Source # matchM :: MonadFail m => Regex -> Text -> m Text Source #
RegexMaker Regex CompOption ExecOption Text Source # | Since: 1.3.1
Instance details Methods makeRegex :: Text -> Regex Source # makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex Source # makeRegexM :: MonadFail m => Text -> m Regex Source # makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex Source #