cvs: phpdoc /en/functions pcre.xml
| From: | Torben Wilson | Date: | Thu, 01 Mar 2001 00:19:18 +0000 |
| Subject: | cvs: phpdoc /en/functions pcre.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969334526@lists.php.net to get a copy of this message | ||
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 = "<b>bold text</b><a href=howdy.html>click
me</a>
preg_match_all ("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/",
$html, $matches);