Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Creates a back-end implementation, conforming to https://hackage.haskell.org/packages/archive/regex-base/latest/doc/html/Text-Regex-Base-RegexLike.html.
CAVEATS
- The underlying polymorphic (in terms of the base-type of the list of input data)
ExtendedRegEx
-engine is never going to be a drop-in replacement for other regex-engines, so this standard interface has only been implemented for traditional input data-type [Char
]. - The standard interface requires many Haskell-extensions, but since this implementation is just a thin layer over the underlying portable polymorphic
ExtendedRegEx
-engine, the latter can still be used directly, where any of these extensions are unavailable.
Synopsis
- type MatchSpan = (MatchOffset, MatchLength)
- type RegExOptsChar = RegExOpts ExtendedRegExChar
- toZeroIndexedArray :: [e] -> Array Int e
- (=~) :: RegexContext RegExOptsChar InputData target => InputData -> String -> target
Types
Type-synonyms
type MatchSpan = (MatchOffset, MatchLength) Source #
type RegExOptsChar = RegExOpts ExtendedRegExChar Source #
Defines a specific instance of the polymorphic base-type.
Functions
toZeroIndexedArray :: [e] -> Array Int e Source #
Convert the specified list, into a zero-indexed array.
Operators
:: RegexContext RegExOptsChar InputData target | |
=> InputData | The input data. |
-> String | The string from which to read the regex-specification. |
-> target | The polymorphic return-type. |
- Match-operator.
- The polymorphic return-type is resolved by the caller's RegexLike.RegexContext.
Predicates
Orphan instances
RegexLike RegExOptsChar InputData Source # | |
matchOnce :: RegExOptsChar -> InputData -> Maybe MatchArray # matchAll :: RegExOptsChar -> InputData -> [MatchArray] # matchCount :: RegExOptsChar -> InputData -> Int # matchTest :: RegExOptsChar -> InputData -> Bool # matchAllText :: RegExOptsChar -> InputData -> [MatchText InputData] # matchOnceText :: RegExOptsChar -> InputData -> Maybe (InputData, MatchText InputData, InputData) # | |
RegexOptions RegExOptsChar CompilationOptions ExecutionOptions Source # | |
RegexMaker RegExOptsChar CompilationOptions ExecutionOptions String Source # | |
makeRegex :: String -> RegExOptsChar # makeRegexOpts :: CompilationOptions -> ExecutionOptions -> String -> RegExOptsChar # makeRegexM :: Monad m => String -> m RegExOptsChar # makeRegexOptsM :: Monad m => CompilationOptions -> ExecutionOptions -> String -> m RegExOptsChar # |