mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
update preg_match_all() example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@29413 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0b2543e52a
commit
378c28cc33
1 changed files with 3 additions and 0 deletions
|
@ -248,6 +248,9 @@ preg_match_all ("/\(? (\d{3})? \)? (?(1) [\-\s] ) \d{3}-\d{4}/x",
|
|||
<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);
|
||||
|
|
Loading…
Reference in a new issue