PCRE.preg_match

Perform a regular expression match. Note that this method internally allocates and then frees a C pcre object each time it is called. If you want to run the same regex search multiple times on different input, you are probably better off using the compile() method, above.

Usage: auto regex = new PCRE; bool match = regex.preg_match("Hello World!", "^Hello");

class PCRE
bool
preg_match

Parameters

subject cstring

the compiled patter will be matched against this string

pattern cstring

pattern to search for, as a string

case_sens bool

case sensitive matching

Return Value

Type: bool

true, if matches or false if no match

Throws

if the compilation or running of the regex fails

Meta