yi-language-0.19.2: Collection of language-related Yi libraries.
Safe HaskellNone
LanguageHaskell2010

Yi.Regex

Synopsis

Documentation

data SearchOption Source #

Constructors

IgnoreCase

Compile for matching that ignores char case

NoNewLine

Compile for newline-insensitive matching

QuoteRegex

Treat the input not as a regex but as a literal string to search for.

Instances

Instances details
Binary SearchOption Source # 
Instance details

Defined in Yi.Regex

Generic SearchOption Source # 
Instance details

Defined in Yi.Regex

Associated Types

type Rep SearchOption 
Instance details

Defined in Yi.Regex

type Rep SearchOption = D1 ('MetaData "SearchOption" "Yi.Regex" "yi-language-0.19.2-9aqnsb1TqRMA1LJA09MZJx" 'False) (C1 ('MetaCons "IgnoreCase" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NoNewLine" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "QuoteRegex" 'PrefixI 'False) (U1 :: Type -> Type)))
Eq SearchOption Source # 
Instance details

Defined in Yi.Regex

type Rep SearchOption Source # 
Instance details

Defined in Yi.Regex

type Rep SearchOption = D1 ('MetaData "SearchOption" "Yi.Regex" "yi-language-0.19.2-9aqnsb1TqRMA1LJA09MZJx" 'False) (C1 ('MetaCons "IgnoreCase" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NoNewLine" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "QuoteRegex" 'PrefixI 'False) (U1 :: Type -> Type)))

data SearchExp Source #

Instances

Instances details
Binary SearchExp Source # 
Instance details

Defined in Yi.Regex

emptyRegex :: Regex Source #

The regular expression that matches nothing.

regexEscapeString :: String -> String Source #

Return an escaped (for parseRegex use) version of the string.

reversePattern :: (Pattern, (t, DoPa)) -> (Pattern, (t, DoPa)) Source #

Reverse a pattern. Note that the submatches will be reversed as well.

data CompOption #

Instances

Instances details
Read CompOption 
Instance details

Defined in Text.Regex.TDFA.Common

Show CompOption 
Instance details

Defined in Text.Regex.TDFA.Common

RegexOptions Regex CompOption ExecOption 
Instance details

Defined in Text.Regex.TDFA.Common

Methods

blankCompOpt :: CompOption

blankExecOpt :: ExecOption

defaultCompOpt :: CompOption #

defaultExecOpt :: ExecOption #

setExecOpts :: ExecOption -> Regex -> Regex

getExecOpts :: Regex -> ExecOption

RegexMaker Regex CompOption ExecOption ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString

RegexMaker Regex CompOption ExecOption ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString.Lazy

RegexMaker Regex CompOption ExecOption Text 
Instance details

Defined in Text.Regex.TDFA.Text

Methods

makeRegex :: Text -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex

makeRegexM :: MonadFail m => Text -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex #

RegexMaker Regex CompOption ExecOption Text 
Instance details

Defined in Text.Regex.TDFA.Text.Lazy

Methods

makeRegex :: Text -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex

makeRegexM :: MonadFail m => Text -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex #

RegexMaker Regex CompOption ExecOption String 
Instance details

Defined in Text.Regex.TDFA.String

Methods

makeRegex :: String -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> String -> Regex

makeRegexM :: MonadFail m => String -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> String -> m Regex #

RegexMaker Regex CompOption ExecOption (Seq Char) 
Instance details

Defined in Text.Regex.TDFA.Sequence

Methods

makeRegex :: Seq Char -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> Seq Char -> Regex

makeRegexM :: MonadFail m => Seq Char -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Seq Char -> m Regex #

newtype AllTextSubmatches (f :: Type -> Type) b #

Constructors

AllTextSubmatches 

Fields

Instances

Instances details
RegexLike a b => RegexContext a b (AllTextSubmatches (Array Int) (b, (MatchOffset, MatchLength))) 
Instance details

Defined in Text.Regex.Base.Context

Methods

match :: a -> b -> AllTextSubmatches (Array Int) (b, (MatchOffset, MatchLength))

matchM :: MonadFail m => a -> b -> m (AllTextSubmatches (Array Int) (b, (MatchOffset, MatchLength)))

RegexLike a b => RegexContext a b (AllTextSubmatches (Array Int) b) 
Instance details

Defined in Text.Regex.Base.Context

Methods

match :: a -> b -> AllTextSubmatches (Array Int) b

matchM :: MonadFail m => a -> b -> m (AllTextSubmatches (Array Int) b)

RegexLike a b => RegexContext a b (AllTextSubmatches [] (b, (MatchOffset, MatchLength))) 
Instance details

Defined in Text.Regex.Base.Context

Methods

match :: a -> b -> AllTextSubmatches [] (b, (MatchOffset, MatchLength))

matchM :: MonadFail m => a -> b -> m (AllTextSubmatches [] (b, (MatchOffset, MatchLength)))

RegexLike a b => RegexContext a b (AllTextSubmatches [] b) 
Instance details

Defined in Text.Regex.Base.Context

Methods

match :: a -> b -> AllTextSubmatches [] b

matchM :: MonadFail m => a -> b -> m (AllTextSubmatches [] b)

class Extract source => RegexLike regex source where #

Minimal complete definition

Nothing

Methods

matchAll :: regex -> source -> [MatchArray] #

matchOnceText :: regex -> source -> Maybe (source, MatchText source, source) #

Instances

Instances details
RegexLike Regex ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString

RegexLike Regex ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString.Lazy

RegexLike Regex Text 
Instance details

Defined in Text.Regex.TDFA.Text

Methods

matchOnce :: Regex -> Text -> Maybe MatchArray

matchAll :: Regex -> Text -> [MatchArray] #

matchCount :: Regex -> Text -> Int

matchTest :: Regex -> Text -> Bool

matchAllText :: Regex -> Text -> [MatchText Text]

matchOnceText :: Regex -> Text -> Maybe (Text, MatchText Text, Text) #

RegexLike Regex Text 
Instance details

Defined in Text.Regex.TDFA.Text.Lazy

Methods

matchOnce :: Regex -> Text -> Maybe MatchArray

matchAll :: Regex -> Text -> [MatchArray] #

matchCount :: Regex -> Text -> Int

matchTest :: Regex -> Text -> Bool

matchAllText :: Regex -> Text -> [MatchText Text]

matchOnceText :: Regex -> Text -> Maybe (Text, MatchText Text, Text) #

RegexLike Regex String 
Instance details

Defined in Text.Regex.TDFA.String

Methods

matchOnce :: Regex -> String -> Maybe MatchArray

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

matchCount :: Regex -> String -> Int

matchTest :: Regex -> String -> Bool

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

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

RegexLike Regex (Seq Char) 
Instance details

Defined in Text.Regex.TDFA.Sequence

Methods

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

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

matchCount :: Regex -> Seq Char -> Int

matchTest :: Regex -> Seq Char -> Bool

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

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

makeRegex :: RegexMaker regex compOpt execOpt source => source -> regex #

makeRegexOptsM :: (RegexMaker regex compOpt execOpt source, MonadFail m) => compOpt -> execOpt -> source -> m regex #

defaultCompOpt :: RegexOptions regex compOpt execOpt => compOpt #

defaultExecOpt :: RegexOptions regex compOpt execOpt => execOpt #

data Regex #

Instances

Instances details
RegexLike Regex ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString

RegexLike Regex ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString.Lazy

RegexLike Regex Text 
Instance details

Defined in Text.Regex.TDFA.Text

Methods

matchOnce :: Regex -> Text -> Maybe MatchArray

matchAll :: Regex -> Text -> [MatchArray] #

matchCount :: Regex -> Text -> Int

matchTest :: Regex -> Text -> Bool

matchAllText :: Regex -> Text -> [MatchText Text]

matchOnceText :: Regex -> Text -> Maybe (Text, MatchText Text, Text) #

RegexLike Regex Text 
Instance details

Defined in Text.Regex.TDFA.Text.Lazy

Methods

matchOnce :: Regex -> Text -> Maybe MatchArray

matchAll :: Regex -> Text -> [MatchArray] #

matchCount :: Regex -> Text -> Int

matchTest :: Regex -> Text -> Bool

matchAllText :: Regex -> Text -> [MatchText Text]

matchOnceText :: Regex -> Text -> Maybe (Text, MatchText Text, Text) #

RegexLike Regex String 
Instance details

Defined in Text.Regex.TDFA.String

Methods

matchOnce :: Regex -> String -> Maybe MatchArray

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

matchCount :: Regex -> String -> Int

matchTest :: Regex -> String -> Bool

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

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

RegexContext Regex ByteString ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString

RegexContext Regex ByteString ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString.Lazy

RegexContext Regex Text Text 
Instance details

Defined in Text.Regex.TDFA.Text

Methods

match :: Regex -> Text -> Text

matchM :: MonadFail m => Regex -> Text -> m Text

RegexContext Regex Text Text 
Instance details

Defined in Text.Regex.TDFA.Text.Lazy

Methods

match :: Regex -> Text -> Text

matchM :: MonadFail m => Regex -> Text -> m Text

RegexContext Regex String String 
Instance details

Defined in Text.Regex.TDFA.String

Methods

match :: Regex -> String -> String

matchM :: MonadFail m => Regex -> String -> m String

RegexOptions Regex CompOption ExecOption 
Instance details

Defined in Text.Regex.TDFA.Common

Methods

blankCompOpt :: CompOption

blankExecOpt :: ExecOption

defaultCompOpt :: CompOption #

defaultExecOpt :: ExecOption #

setExecOpts :: ExecOption -> Regex -> Regex

getExecOpts :: Regex -> ExecOption

RegexMaker Regex CompOption ExecOption ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString

RegexMaker Regex CompOption ExecOption ByteString 
Instance details

Defined in Text.Regex.TDFA.ByteString.Lazy

RegexMaker Regex CompOption ExecOption Text 
Instance details

Defined in Text.Regex.TDFA.Text

Methods

makeRegex :: Text -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex

makeRegexM :: MonadFail m => Text -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex #

RegexMaker Regex CompOption ExecOption Text 
Instance details

Defined in Text.Regex.TDFA.Text.Lazy

Methods

makeRegex :: Text -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> Text -> Regex

makeRegexM :: MonadFail m => Text -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Text -> m Regex #

RegexMaker Regex CompOption ExecOption String 
Instance details

Defined in Text.Regex.TDFA.String

Methods

makeRegex :: String -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> String -> Regex

makeRegexM :: MonadFail m => String -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> String -> m Regex #

RegexMaker Regex CompOption ExecOption (Seq Char) 
Instance details

Defined in Text.Regex.TDFA.Sequence

Methods

makeRegex :: Seq Char -> Regex #

makeRegexOpts :: CompOption -> ExecOption -> Seq Char -> Regex

makeRegexM :: MonadFail m => Seq Char -> m Regex

makeRegexOptsM :: MonadFail m => CompOption -> ExecOption -> Seq Char -> m Regex #

RegexLike Regex (Seq Char) 
Instance details

Defined in Text.Regex.TDFA.Sequence

Methods

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

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

matchCount :: Regex -> Seq Char -> Int

matchTest :: Regex -> Seq Char -> Bool

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

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

RegexContext Regex (Seq Char) (Seq Char) 
Instance details

Defined in Text.Regex.TDFA.Sequence

Methods

match :: Regex -> Seq Char -> Seq Char

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

(=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target #