regex-tdfa-1.3.1.0: Pure Haskell Tagged DFA Backend for "Text.Regex" (regex-base)
Safe HaskellNone
LanguageHaskell2010

Text.Regex.TDFA.Sequence

Description

This modules provides RegexMaker and RegexLike instances for using ByteString with the DFA backend (Text.Regex.Lib.WrapDFAEngine and Text.Regex.Lazy.DFAEngineFPS). This module is usually used via import Text.Regex.TDFA.

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

Synopsis

Documentation

data Regex Source #

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

Instances

Instances details
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 #

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 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 #

RegexOptions Regex CompOption ExecOption Source # 
Instance details

Defined in Text.Regex.TDFA.Common

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 #

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 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 #

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 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 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 (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

readList :: ReadS [CompOption]

readPrec :: ReadPrec CompOption

readListPrec :: ReadPrec [CompOption]

Show CompOption Source # 
Instance details

Defined in Text.Regex.TDFA.Common

Methods

showsPrec :: Int -> CompOption -> ShowS

show :: CompOption -> String

showList :: [CompOption] -> ShowS

RegexOptions Regex CompOption ExecOption Source # 
Instance details

Defined in Text.Regex.TDFA.Common

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 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 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 (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

readList :: ReadS [ExecOption]

readPrec :: ReadPrec ExecOption

readListPrec :: ReadPrec [ExecOption]

Show ExecOption Source # 
Instance details

Defined in Text.Regex.TDFA.Common

Methods

showsPrec :: Int -> ExecOption -> ShowS

show :: ExecOption -> String

showList :: [ExecOption] -> ShowS

RegexOptions Regex CompOption ExecOption Source # 
Instance details

Defined in Text.Regex.TDFA.Common

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 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 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 (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)

-> Seq Char

The regular expression to compile

-> Either String Regex

Returns: the compiled regular expression

execute Source #

Arguments

:: Regex

Compiled regular expression

-> Seq Char

ByteString to match against

-> Either String (Maybe MatchArray) 

regexec Source #

Arguments

:: Regex

Compiled regular expression

-> Seq Char

ByteString to match against

-> Either String (Maybe (Seq Char, Seq Char, Seq Char, [Seq Char])) 

Orphan instances

RegexMaker Regex CompOption ExecOption (Seq Char) Source # 
Instance details

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

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

Methods

match :: Regex -> Seq Char -> Seq Char Source #

matchM :: MonadFail m => Regex -> Seq Char -> m (Seq Char) Source #