ContentsIndex
RRegex.PCRE
Synopsis
data Regex
compile :: String -> Int -> IO (Either (Int, String) Regex)
execute :: Regex -> String -> Int -> IO (Maybe (Array Int (Int, Int)))
executeExtract :: Regex -> String -> Int -> IO (Maybe (String, String, Array Int String))
pcreCaseless :: Int
pcreMultiline :: Int
pcreDotall :: Int
pcreExtended :: Int
pcreAnchored :: Int
pcreDollarEndonly :: Int
pcreExtra :: Int
pcreNotbol :: Int
pcreNoteol :: Int
pcreUngreedy :: Int
pcreNotempty :: Int
getVersion :: Maybe String
Documentation
data Regex
A compiled regular expression
Instances
RegexLike Regex Char
compile
:: StringThe regular expression to compile
-> IntFlags (summed together)
-> IO (Either (Int, String) Regex)Returns: an error string and offset or the compiled regular expression
Compiles a regular expression
execute
:: RegexCompiled regular expression
-> StringString to match against
-> IntOptions
-> IO (Maybe (Array Int (Int, Int)))Returns: Nothing if the regex did not match the string, or: Just an array of (offset,length) pairs where index 0 is whole match, and the rest are the captured subexpressions.
Matches a regular expression against a string
executeExtract
:: Regexcompiled regular expression
-> Stringstring to match
-> IntFlags (summed together)
-> IO (Maybe (String, String, Array Int String))Returns: Nothing if no match, else (text before match, text after match, array of matches with 0 being the whole match)
execute match and extract substrings rather than just offsets
pcreCaseless :: Int
pcreMultiline :: Int
pcreDotall :: Int
pcreExtended :: Int
pcreAnchored :: Int
pcreDollarEndonly :: Int
pcreExtra :: Int
pcreNotbol :: Int
pcreNoteol :: Int
pcreUngreedy :: Int
pcreNotempty :: Int
getVersion :: Maybe String
return version of pcre used or Nothing if pcre is not available.
Produced by Haddock version 0.6