standard.lib.preg.preg_match

preg_match is available since version 1.0.

Prototype:

number preg_match(string string_to_parse, string pattern[, number options])

Parameters

string_to_parse
the string to be parsed
pattern
the pattern
options
a conbination of : PCRE_MULTILINE, PCRE_DOTALL, PCRE_EXTENDED, PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, PCRE_EXTRA, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_UNGREEDY, PCRE_NOTEMPTY, PCRE_UTF8, PCRE_NO_AUTO_CAPTURE, PCRE_NO_UTF8_CHECK, PCRE_AUTO_CALLOUT, PCRE_PARTIAL, PCRE_DFA_SHORTEST, PCRE_DFA_RESTART, PCRE_FIRSTLINE

Description:

Perform a regular expression match. Searches string_to_parse for a match to the regular expression given in pattern.

Return value:

Returns string describing an error, if an error was encountered, or a number if succeeded. If a match was found, an non-null number will be returned; else 0 will be returned.