| 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
A representation of a regular expression.
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 #
Match a Regex against a bytestring.  Returns Nothing if
 no match, otherwise Just a nonempty list of bytestrings. The first
 bytestring in the list is the match, the others the captures, if any.
 If there are errors in executing the regex, a RegexException is
 thrown.
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{...}.