|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-12-05 01:28 UTC] cmanley at xs4all dot nl
-PHP Version: 5.6.16
+PHP Version: 5.6.14-0+deb8u1
[2015-12-05 01:28 UTC] cmanley at xs4all dot nl
[2015-12-05 01:55 UTC] requinix@php.net
-Status: Open
+Status: Verified
[2016-06-17 14:53 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ The documentation for the x (PCRE_EXTENDED) modifier states: "characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored" Yet this is not the case in my test example: The "/" in the regex comment "# firstname/alias" is seen as a regex delimiter. Test script: --------------- <?php $fullname = 'Joe Blow'; if (preg_match('/^ (\S+) # firstname/alias \s+ \S+ # surname $/x', $fullname, $matches)) { print $matches[1] . "\n"; } Expected result: ---------------- Joe Actual result: -------------- PHP Warning: preg_match(): Unknown modifier 'a' in /home/cmanley/t.php on line 8