vrana Tue Sep 20 07:42:59 2005 EDT
Modified files: /phpdoc/en/reference/pcre pattern.syntax.xml Log: Note about \ in PHP strings (bug #34562) http://cvs.php.net/diff.php/phpdoc/en/reference/pcre/pattern.syntax.xml?r1=1.10&r2=1.11&ty=u Index: phpdoc/en/reference/pcre/pattern.syntax.xml diff -u phpdoc/en/reference/pcre/pattern.syntax.xml:1.10 phpdoc/en/reference/pcre/pattern.syntax.xml:1.11 --- phpdoc/en/reference/pcre/pattern.syntax.xml:1.10 Thu Jun 23 10:35:56 2005 +++ phpdoc/en/reference/pcre/pattern.syntax.xml Tue Sep 20 07:42:58 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 --> <refentry id="reference.pcre.pattern.syntax"> <refnamediv> @@ -60,7 +60,7 @@ <simpara> Though binary zero characters are supported in the subject string, they are not allowed in a pattern string because it is passed as a - normal C string, terminated by zero. The escape sequence "\\x00" can + normal C string, terminated by zero. The escape sequence "\x00" can be used in the pattern to represent a binary zero. </simpara> </listitem> @@ -290,6 +290,14 @@ with "\" to specify that it stands for itself. In particular, if you want to match a backslash, you write "\\". </para> + <note> + <para> + Single and double quoted PHP <link + linkend="language.types.string.syntax">strings</link> have special + meaning of backslash. Thus if \ has to be matched with a regular + expression \\, then "\\\\" or '\\\\' must be used in PHP code. + </para> + </note> <para> If a pattern is compiled with the <link linkend="reference.pcre.pattern.modifiers">PCRE_EXTENDED</link> option,