[PHP-DOC] cvs: phpdoc /en/functions pcre.xml From: Torben Wilson (torben <email protected>)
Date: 02/28/01

torben Wed Feb 28 16:19:18 2001 EDT

  Modified files:
    /phpdoc/en/functions pcre.xml
  Log:
  
  
  Fixed up a bit of grammar and added a note about backrefs and backslashes.
  
  
Index: phpdoc/en/functions/pcre.xml
diff -u phpdoc/en/functions/pcre.xml:1.43 phpdoc/en/functions/pcre.xml:1.44
--- phpdoc/en/functions/pcre.xml:1.43 Thu Feb 22 07:28:36 2001
+++ phpdoc/en/functions/pcre.xml Wed Feb 28 16:19:18 2001
@@ -259,9 +259,10 @@
      <example>
       <title>Find matching HTML tags (greedy)</title>
       <programlisting role="php">
-// the \\2 is an example of backreferencing. This tells pcre that
-// it must match the 2nd set of parenthesis in the regular expression
-// itself, which would be the ([\w]+) in this case.
+// The \\2 is an example of backreferencing. This tells pcre that
+// it must match the second set of parentheses in the regular expression
+// itself, which would be the ([\w]+) in this case. The extra backslash is
+// required because the string is in double quotes.
 $html = "&lt;b&gt;bold text&lt;/b&gt;&lt;a href=howdy.html&gt;click me&lt;/a&gt;
 
 preg_match_all ("/(&lt;([\w]+)[^&gt;]*&gt;)(.*)(&lt;\/\\2&gt;)/", $html, $matches);