Safe Haskell | None |
---|---|
Language | Haskell2010 |
Skylighting.Regex
- data Regex :: *
- data RegexException
- data RE = RE {}
- compileRegex :: Bool -> ByteString -> Regex
- matchRegex :: Regex -> ByteString -> Maybe [ByteString]
- convertOctalEscapes :: String -> String
Documentation
data RegexException Source #
Instances
Constructors
RE | |
Fields
|
compileRegex :: Bool -> ByteString -> Regex Source #
Compile a PCRE regex. If the first parameter is True, the regex is
case-sensitive, otherwise caseless. The regex is compiled from
a bytestring interpreted as UTF-8. If the regex cannot be compiled,
a RegexException
is thrown.
matchRegex :: Regex -> ByteString -> Maybe [ByteString] Source #
convertOctalEscapes :: String -> String Source #
Convert octal escapes to the form pcre wants. Note: need at least pcre 8.34 for the form o{dddd}. So we prefer ddd or x{...}.