mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Explain $n backreferences.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@35813 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
aed7d37ec7
commit
f08d4fefdb
1 changed files with 9 additions and 9 deletions
|
@ -315,15 +315,15 @@ part 3: </a>
|
|||
matches are replaced.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>Replacement</parameter> may contain references of the
|
||||
form <literal>\\<replaceable>n</replaceable></literal>. Every
|
||||
such reference will be replaced by the text captured by the
|
||||
<replaceable>n</replaceable>'th parenthesized pattern.
|
||||
<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
|
||||
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> 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.
|
||||
<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.
|
||||
</para>
|
||||
<para>
|
||||
If no matches are found in <parameter>subject</parameter>, then
|
||||
|
@ -692,7 +692,7 @@ $fl_array = preg_grep ("/^(\d+)?\.\d+$/", $array);
|
|||
<listitem>
|
||||
<simpara>
|
||||
If this modifier is set, <function>preg_replace</function>
|
||||
does normal substitution of \\ references in the
|
||||
does normal substitution of backreferences in the
|
||||
replacement string, evaluates it as PHP code, and uses the
|
||||
result for replacing the search string.
|
||||
</simpara>
|
||||
|
|
Loading…
Reference in a new issue