Safe Haskell | None |
---|---|
Language | Haskell2010 |
Yi.Regex
Synopsis
- data SearchOption
- makeSearchOptsM :: [SearchOption] -> String -> Either String SearchExp
- data SearchExp = SearchExp {
- seInput :: String
- seCompiled :: Regex
- seBackCompiled :: Regex
- seOptions :: [SearchOption]
- searchString :: SearchExp -> String
- searchRegex :: Direction -> SearchExp -> Regex
- emptySearch :: SearchExp
- emptyRegex :: Regex
- regexEscapeString :: String -> String
- reversePattern :: (Pattern, (t, DoPa)) -> (Pattern, (t, DoPa))
- (=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target
- newtype AllTextSubmatches (f :: Type -> Type) b = AllTextSubmatches {
- getAllTextSubmatches :: f b
- class Extract source => RegexLike regex source where
- matchAll :: regex -> source -> [MatchArray]
- matchOnceText :: regex -> source -> Maybe (source, MatchText source, source)
- 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 CompOption = CompOption {
- caseSensitive :: Bool
- multiline :: Bool
- rightAssoc :: Bool
- newSyntax :: Bool
- lastStarGreedy :: Bool
- data Regex
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
Eq SearchOption Source # | |
Defined in Yi.Regex Methods (==) :: SearchOption -> SearchOption -> Bool Source # (/=) :: SearchOption -> SearchOption -> Bool Source # | |
Generic SearchOption Source # | |
Defined in Yi.Regex Methods from :: SearchOption -> Rep SearchOption x Source # to :: Rep SearchOption x -> SearchOption Source # | |
Binary SearchOption Source # | |
type Rep SearchOption Source # | |
Defined in Yi.Regex type Rep SearchOption = D1 ('MetaData "SearchOption" "Yi.Regex" "yi-language-0.19.0-8dDnxQRDjG1jR7I8dgNB1" '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))) |
makeSearchOptsM :: [SearchOption] -> String -> Either String SearchExp Source #
Constructors
SearchExp | |
Fields
|
searchString :: SearchExp -> String Source #
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.
(=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target #
newtype AllTextSubmatches (f :: Type -> Type) b #
Constructors
AllTextSubmatches | |
Fields
|
class Extract source => RegexLike regex source where #
Minimal complete definition
Nothing
Methods
matchAll :: regex -> source -> [MatchArray] #
matchOnceText :: regex -> source -> Maybe (source, MatchText source, source) #
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 CompOption #
Constructors
CompOption | |
Fields
|
Instances
Read CompOption | |
Defined in Text.Regex.TDFA.Common | |
Show CompOption | |
Defined in Text.Regex.TDFA.Common | |
RegexOptions Regex CompOption ExecOption | |
Defined in Text.Regex.TDFA.Common Methods blankExecOpt :: ExecOption defaultCompOpt :: CompOption # defaultExecOpt :: ExecOption # setExecOpts :: ExecOption -> Regex -> Regex getExecOpts :: Regex -> ExecOption |
Instances
RegexOptions Regex CompOption ExecOption | |
Defined in Text.Regex.TDFA.Common Methods blankExecOpt :: ExecOption defaultCompOpt :: CompOption # defaultExecOpt :: ExecOption # setExecOpts :: ExecOption -> Regex -> Regex getExecOpts :: Regex -> ExecOption |