note 114717 added to regexp.reference.onlyonce
| From: | PedroGimeno | Date: | Thu, 27 Mar 2014 18:41:58 +0000 |
| Subject: | note 114717 added to regexp.reference.onlyonce | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199060@lists.php.net to get a copy of this message | ||
The comment by northhero at gmail dot com below is wrong.
<?php
$pattern1 = '((?>\D+)|<\d+>)*[!?]';
$pattern2 = '(\D+|<\d+>)*[!?]';
$subject = 'aaaaaaaaaaaa!';
var_dump(preg_match('/' . $pattern1 . '/', $subject, $match));
var_dump($match);
var_dump(preg_match('/' . $pattern1 . '/', $subject, $match));
var_dump($match);
?>
Output:
int(1)
array(1) {
[0]=>
string(1) "!"
}
int(1)
array(1) {
[0]=>
string(1) "!"
}
Both match.
----
Server IP: 72.52.91.14
Probable Submitter: 82.94.251.227
----
Manual Page -- http://php.net/manual/en/regexp.reference.onlyonce.php
Edit -- https://master.php.net/note/edit/114717
Del: integrated -- https://master.php.net/note/delete/114717/integrated
Del: useless -- https://master.php.net/note/delete/114717/useless
Del: bad code -- https://master.php.net/note/delete/114717/bad+code
Del: spam -- https://master.php.net/note/delete/114717/spam
Del: non-english -- https://master.php.net/note/delete/114717/non-english
Del: in docs -- https://master.php.net/note/delete/114717/in+docs
Del: other reasons-- https://master.php.net/note/delete/114717
Reject -- https://master.php.net/note/reject/114717
Search -- https://master.php.net/manage/user-notes.php