mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document PCRE 4.3
# However, PCRE 5.0 is in the sources now git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@188306 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
400a40a276
commit
c671f559eb
1 changed files with 32 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 -->
|
||||
<refentry id="reference.pcre.pattern.syntax">
|
||||
<refnamediv>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<listitem>
|
||||
<simpara>
|
||||
The following Perl escape sequences are not supported:
|
||||
\l, \u, \L, \U, \E, \Q. In fact these are implemented by
|
||||
\l, \u, \L, \U. In fact these are implemented by
|
||||
Perl's general string-handling and are not part of its
|
||||
pattern matching engine.
|
||||
</simpara>
|
||||
|
@ -575,6 +575,15 @@
|
|||
newline that is the last character of the string as well as at the end of
|
||||
the string, whereas <literal>\z</literal> matches only at the end.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<literal>\Q</literal> and <literal>\E</literal> can be used to ignore
|
||||
regexp metacharacters in the pattern. For example:
|
||||
<literal>\w+\Q.$.\E$</literal> will match one or more word characters,
|
||||
followed by literals <literal>.$.</literal> and anchored at the end of
|
||||
the string.
|
||||
</para>
|
||||
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="regexp.reference.circudollar">
|
||||
|
@ -924,6 +933,13 @@
|
|||
setting in one branch does affect subsequent branches, so
|
||||
the above patterns match "SUNDAY" as well as "Saturday".
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is possible to name the subpattern with
|
||||
<literal>(?P<name>pattern)</literal>. Array with matches will
|
||||
contain the match indexed by the string alongside the match indexed by
|
||||
a number, then.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="regexp.reference.repetition">
|
||||
|
@ -1057,6 +1073,13 @@
|
|||
them with a question mark. In other words, it inverts the
|
||||
default behaviour.
|
||||
</para>
|
||||
<para>
|
||||
Quantifiers followed by <literal>+</literal> are "possessive". They eat
|
||||
as many characters as possible and don't return to match the rest of the
|
||||
pattern. Thus <literal>.*abc</literal> matches "aabc" but
|
||||
<literal>.*+abc</literal> doesn't because <literal>.*+</literal> eats the
|
||||
whole string. Possessive quantifiers can be used to speed up processing.
|
||||
</para>
|
||||
<para>
|
||||
When a parenthesized subpattern is quantified with a minimum
|
||||
repeat count that is greater than 1 or with a limited maximum,
|
||||
|
@ -1556,6 +1579,13 @@
|
|||
there is no way to give an out-of-memory error from within a
|
||||
recursion.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<literal>(?1)</literal>, <literal>(?2)</literal> and so on can be used
|
||||
for recursive subpatterns too. It is also possible to use named
|
||||
subpatterns: <literal>(?P>foo)</literal>.
|
||||
</para>
|
||||
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="regexp.reference.performances">
|
||||
|
|
Loading…
Reference in a new issue