note 86705 added to function.preg-match

From: Date: Thu, 30 Oct 2008 20:35:06 +0000
Subject: note 86705 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-145977@lists.php.net to get a copy of this message
Example #4 is incorrectly listed as: <?php $str = 'foobar: 2008'; preg_match('/(?<name>\w+): (?<digit>\d+)/', $str, $matches); print_r($matches); ?> The above will produce the following error: Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 3 The example should be listed as: <?php $str = 'foobar: 2008'; preg_match('/(?P<name>\w+): (?P<digit>\d+)/', $str, $matches); print_r($matches); ?> ---- Server IP: 64.71.164.2 Probable Submitter: 216.82.251.227 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/86705 Del: integrated -- https://master.php.net/note/delete/86705/integrated Del: useless -- https://master.php.net/note/delete/86705/useless Del: bad code -- https://master.php.net/note/delete/86705/bad+code Del: spam -- https://master.php.net/note/delete/86705/spam Del: non-english -- https://master.php.net/note/delete/86705/non-english Del: in docs -- https://master.php.net/note/delete/86705/in+docs Del: other reasons-- https://master.php.net/note/delete/86705 Reject -- https://master.php.net/note/reject/86705 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#145977) next »