note 114717 deleted from regexp.reference.onlyonce by salathe

From: Date: Mon, 17 Nov 2014 15:57:20 +0000
Subject: note 114717 deleted from regexp.reference.onlyonce by salathe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-200936@lists.php.net to get a copy of this message
Note Submitter: Pedro Gimeno ---- 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.

« previous php.notes (#200936) next »