Regex

11 entries

PCRE pattern modifiers (i/m/s/x/u/D) Function A semantics table for PCRE modifiers — i (case), m (line anchors), s (dot-all), x (free-spacing), u (UTF-8), D (strict $) — and how each language's flag system maps to them. preg_filter Function Performs a preg_replace-style substitution but returns only the elements that were replaced — on arrays it is filter-and-replace in one. preg_grep Function Returns the array elements that match a pattern (original keys preserved). preg_last_error Function Returns the error code of the most recent PCRE failure. preg_match Function Searches a string for a match using a regular expression. preg_match_all Function Searches a string for all matches of a regular expression (not just the first) and returns the match count. preg_quote Function Escapes the special characters in a regular expression. preg_replace Function Replaces matches in a string using a regular expression. preg_replace_callback Function Finds every match of a regular expression and calls a callback to compute the replacement text for each. preg_replace_callback_array Function Runs a regex substitution with one callback per pattern (PHP 7+), handling many token kinds in a single call instead of stacked preg_replace_callback calls. preg_split Function Splits a string using a regular expression as the delimiter.