PHP Regular Expression (Perl-Compatible) Functions
EditRocket provides the following information on Regular Expression (Perl-Compatible) functions in the PHP source code builder.
array preg_grep ( string $pattern , array $input [, int $flags ] ) - Returns the array consisting of the elements of the input array that match the given pattern.
int preg_last_error ( void ) - Returns the error code of the last PCRE regex execution.
int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags [, int $offset ]]] ) - Searches subject for a match to the regular expression given in pattern.
int preg_match_all ( string $pattern , string $subject , array &$matches [, int $flags [, int $offset ]] ) - Searches subject for all matches to the regular expression given in pattern and puts them in matches in the order specified by flags.
string preg_quote ( string $str [, string $delimiter ] ) - preg_quote() takes str and puts a backslash in front of every character that is part of the regular expression syntax. This is useful if you have a run-time string that you need to match in some text and the string may contain special regex characters.
mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit [, int &$count ]] ) - Searches subject for matches to pattern and replaces them with replacement.
mixed preg_replace_callback ( mixed $pattern , callback $callback , mixed $subject [, int $limit [, int &$count ]] ) -
array preg_split ( string $pattern , string $subject [, int $limit [, int $flags ]] ) - Split the given string by a regular expression.