Date: 07/31/00
- Next message: Monte Ohrt: "[PHP-DOC] cvs: phpdoc /en/functions pcre.xml"
- Previous message: Daniel Beckham: "[PHP-DOC] cvs: phpdoc /en/functions filesystem.xml"
- Next in thread: Monte Ohrt: "[PHP-DOC] cvs: phpdoc /en/functions pcre.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
mohrt Mon Jul 31 08:31:46 2000 EDT
Modified files:
/phpdoc/en/functions pcre.xml
Log:
update preg_match_all() example
Index: phpdoc/en/functions/pcre.xml
diff -u phpdoc/en/functions/pcre.xml:1.22 phpdoc/en/functions/pcre.xml:1.23
--- phpdoc/en/functions/pcre.xml:1.22 Fri Jul 28 14:27:09 2000
+++ phpdoc/en/functions/pcre.xml Mon Jul 31 08:31:46 2000
@@ -248,6 +248,9 @@
<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.
$html = "<b>bold text</b><a href=howdy.html>click me</a>
preg_match_all ("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches);
- Next message: Monte Ohrt: "[PHP-DOC] cvs: phpdoc /en/functions pcre.xml"
- Previous message: Daniel Beckham: "[PHP-DOC] cvs: phpdoc /en/functions filesystem.xml"
- Next in thread: Monte Ohrt: "[PHP-DOC] cvs: phpdoc /en/functions pcre.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

