cvs: phpdoc /en/reference/pcre/functions preg-replace.xml
| From: | Jakub Vrana | Date: | Fri, 07 Nov 2008 14:42:12 +0000 |
| Subject: | cvs: phpdoc /en/reference/pcre/functions preg-replace.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2459@lists.php.net to get a copy of this message | ||
vrana Fri Nov 7 14:42:12 2008 UTC
Modified files:
/phpdoc/en/reference/pcre/functions preg-replace.xml
Log:
Backslash in replacement (bug #43532)
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/pcre/functions/preg-replace.xml?r1=1.28&r2=1.29&diff_format=u
Index: phpdoc/en/reference/pcre/functions/preg-replace.xml
diff -u phpdoc/en/reference/pcre/functions/preg-replace.xml:1.28
phpdoc/en/reference/pcre/functions/preg-replace.xml:1.29
--- phpdoc/en/reference/pcre/functions/preg-replace.xml:1.28 Fri Nov 7 14:38:01 2008
+++ phpdoc/en/reference/pcre/functions/preg-replace.xml Fri Nov 7 14:42:12 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.28 $ -->
+<!-- $Revision: 1.29 $ -->
<refentry xml:id="function.preg-replace" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>preg_replace</refname>
@@ -61,13 +61,15 @@
<para>
<parameter>replacement</parameter> may contain references of the form
<literal>\\<replaceable>n</replaceable></literal> or (since PHP
4.0.4)
- <literal><replaceable>$n</replaceable></literal>, with the latter
form
+ <literal>$<replaceable>n</replaceable></literal>, with the latter
form
being the preferred one. Every such reference will be replaced by the text
captured by the <replaceable>n</replaceable>'th parenthesized pattern.
<replaceable>n</replaceable> can be from 0 to 99, and
<literal>\\0</literal> or <literal>$0</literal> refers to the text
matched
by the whole pattern. Opening parentheses are counted from left to right
(starting from 1) to obtain the number of the capturing subpattern.
+ To use backslash in replacement, it must be doubled
+ (<literal>"\\\\"</literal> PHP string).
</para>
<para>
When working with a replacement pattern where a backreference is