pugs-hsregex-1.0: Haskell PCRE binding

RRegex.PCRE

Synopsis

Documentation

data Regex Source

A compiled regular expression

compileSource

Arguments

:: String

The regular expression to compile

-> Int

Flags (summed together)

-> IO (Either (Int, String) Regex)

Returns: an error string and offset or the compiled regular expression

Compiles a regular expression

executeSource

Arguments

:: Regex

Compiled regular expression

-> String

String to match against

-> Int

Options

-> 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

executeExtractSource

Arguments

:: Regex

compiled regular expression

-> String

string to match

-> Int

Flags (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

getVersion :: Maybe StringSource

return version of pcre used or Nothing if pcre is not available.