diff --git a/functions/pcre.xml b/functions/pcre.xml index c25ae91463..f6e50e1d33 100644 --- a/functions/pcre.xml +++ b/functions/pcre.xml @@ -6,10 +6,11 @@ The syntax for patterns used in these functions closely resembles Perl. The expression should be enclosed in the delimiters, a - forward slash (/), for example. Any character can be used for + forward slash (/), for example. Any character can be used for delimiter as long as it's not alphanumeric or backslash (\). If the delimiter character has to be used in the expression itself, - it needs to be escaped by backslash. + it needs to be escaped by backslash. Since PHP 4.0.4, you can also use + Perl-style (), {}, [], and <> matching delimiters. The ending delimiter may be followed by various modifiers that @@ -23,6 +24,7 @@ /<\/\w+>/ |(\d{3})-\d+|Sm /^(?i)php[34]/ + {^\s+(\s+)?$} @@ -362,6 +364,13 @@ part 3: </a> code string, otherwise PHP will complain about a parse error at the line containing preg_replace. + + /F modifier means that the + replacement is taken to be a function name. This + function will be called and passed an array of matched elements in the + subject string. The function should return the replacement string. This + modifier was added in PHP 4.0.4. + Replacing several values @@ -694,7 +703,8 @@ $fl_array = preg_grep ("/^(\d+)?\.\d+$/", $array); If this modifier is set, preg_replace does normal substitution of backreferences in the replacement string, evaluates it as PHP code, and uses the - result for replacing the search string. + result for replacing the search string. This modifier cannot be used along + with /F modifier. Only preg_replace uses this modifier; @@ -702,6 +712,23 @@ $fl_array = preg_grep ("/^(\d+)?\.\d+$/", $array); + + F + + + If this modifier is set, preg_replace + treats the replacement parameter as a function name that should be called + to provide the replacement string. The function is passed an array of + matched elements in the subject string. This modifier cannot be used along + with /e modifier. + + + Only preg_replace uses this modifier; + it is ignored by other PCRE functions. This modifier was added in PHP + 4.0.4. + + + A (PCRE_ANCHORED)