cvs: phpdoc-zh /reference/pcre/functions pcre.pattern.syntax.xml
| From: | Dallas Thunder | Date: | Sun, 21 Sep 2003 20:43:46 +0000 |
| Subject: | cvs: phpdoc-zh /reference/pcre/functions pcre.pattern.syntax.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1755@lists.php.net to get a copy of this message | ||
dallas Sun Sep 21 16:43:46 2003 EDT
Modified files:
/phpdoc-zh/reference/pcre/functions pcre.pattern.syntax.xml
Log:
Updated.
Index: phpdoc-zh/reference/pcre/functions/pcre.pattern.syntax.xml
diff -u phpdoc-zh/reference/pcre/functions/pcre.pattern.syntax.xml:1.5
phpdoc-zh/reference/pcre/functions/pcre.pattern.syntax.xml:1.6
--- phpdoc-zh/reference/pcre/functions/pcre.pattern.syntax.xml:1.5 Sun Sep 21 16:28:54 2003
+++ phpdoc-zh/reference/pcre/functions/pcre.pattern.syntax.xml Sun Sep 21 16:43:45 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.5 Maintainer: dallas Status: partial -->
<refentry id="pcre.pattern.syntax">
@@ -811,8 +811,8 @@
</screen>
½«Æ¥Åä "ab"£¬"aB"£¬"c" ºÍ
"C"£¬¾¡¹ÜÔÚÆ¥Åä "C"
µÄʱºòµÚÒ»¸ö·ÖÖ§»áÔÚÑ¡ÏîÉ趨֮ǰ¾Í±»¶ªÆú¡£ÕâÊÇÒòΪѡÏîÉ趨µÄЧ¹ûÊÇÔÚ±àÒëʱȷ¶¨µÄ£¬·ñÔò»áÔì³É·Ç³£¹ÖÒìµÄÐÐΪ¡£
- <para>
</para>
+ <para>
PCRE רÓÃÑ¡Ïî
<link linkend="pcre.pattern.modifiers">PCRE_UNGREEDY</link> ºÍ
<link linkend="pcre.pattern.modifiers">PCRE_EXTRA</link>
@@ -822,38 +822,36 @@
</refsect2>
<refsect2 id="regexp.reference.subpatterns">
- <title>subpatterns</title>
- <literallayout>
- Subpatterns are delimited by parentheses (round brackets),
- which can be nested. Marking part of a pattern as a subpattern
- does two things:
-
- 1. It localizes a set of alternatives. For example, the pat-
- tern
-
+ <title>×Óģʽ</title>
+ <para>
+
×ÓģʽÓÉÔ²À¨ºÅ¶¨½ç£¬¿ÉÒÔǶÌס£½«Ä£Ê½ÖеÄÒ»²¿·Ö±ê¼ÇΪ×Óģʽ¿ÉÒÔ£º
+ </para>
+ <para>
+ 1. ½«¶àѡһµÄ·ÖÖ§¾Ö²¿»¯¡£ÀýÈ磬ģʽ£º
+ <screen>
+<![CDATA[
cat(aract|erpillar|)
-
- matches one of the words "cat", "cataract", or "caterpillar".
- Without the parentheses, it would match "cataract",
- "erpillar" or the empty string.
-
- 2. It sets up the subpattern as a capturing subpattern (as
- defined above). When the whole pattern matches, that portion
- of the subject string that matched the subpattern is
- passed back to the caller via the <emphasis>ovector</emphasis>
- argument of
- <function>pcre_exec</function>. Opening parentheses are counted
- from left to right (starting from 1) to obtain the numbers of the
- capturing subpatterns.
-
- For example, if the string "the red king" is matched against
- the pattern
-
+]]>
+ </screen>
+ Æ¥ÅäÁË "cat"£¬"cataract" »ò "caterpillar"
+ Ö®Ò»£¬Ã»ÓÐÔ²À¨ºÅµÄ»°½«Æ¥Åä
"cataract"£¬"erpillar" »ò¿Õ×Ö·û´®¡£
+ </para>
+ <para>
+ 2.
½«×ÓģʽÉ趨Ϊ²¶»ñ×Óģʽ£¨ÈçͬÒÔǰ¶¨ÒåµÄ£©¡£µ±Õû¸öģʽƥÅäʱ£¬Ä¿±ê×Ö·û´®ÖÐÆ¥ÅäÁË×ÓģʽµÄ²¿·Ö»áͨ¹ý
+ <function>pcre_exec</function> µÄ <emphasis>ovector</emphasis>
+ ²ÎÊý´«µÝ»Øµ÷ÓÃÕß¡£×óÔ²À¨ºÅ´Ó×óµ½ÓÒ¼ÆÊý£¨´Ó 1
¿ªÊ¼£©ÒÔÈ¡µÃ²¶»ñ×ÓģʽµÄÊýÄ¿¡£
+ </para>
+ <para>
+ ÀýÈ磬Èç¹û½«×Ö·û´® "the red king" À´ºÍģʽ
+ <screen>
+<![CDATA[
the ((red|white) (king|queen))
-
- the captured substrings are "red king", "red", and "king",
- and are numbered 1, 2, and 3.
-
+]]>
+ </screen>
+ ½øÐÐÆ¥Å䣬²¶»ñµÄ×Ó´®Îª "red king"£¬"red"
+ ÒÔ¼° "king"£¬²¢±»¼ÆÎª 1£¬2 ºÍ 3¡£
+ </para>
+ <literallayout>
The fact that plain parentheses fulfil two functions is not
always helpful. There are often times when a grouping subpattern
is required without a capturing requirement. If an