From 0f8266047756b3878450034912920f32607e2efb Mon Sep 17 00:00:00 2001 From: Torben Wilson Date: Thu, 1 Mar 2001 00:19:18 +0000 Subject: [PATCH] Fixed up a bit of grammar and added a note about backrefs and backslashes. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@42344 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/pcre.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/functions/pcre.xml b/functions/pcre.xml index ca08ee111d..cc25ea823b 100644 --- a/functions/pcre.xml +++ b/functions/pcre.xml @@ -259,9 +259,10 @@ preg_match_all ("/\(? (\d{3})? \)? (?(1) [\-\s] ) \d{3}-\d{4}/x", Find matching HTML tags (greedy) -// 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);