Bug #70037 [NEW]: PCRE_DOLLAR_ENDONLY fails on newlines when used with pipe operator

From: Date: Thu, 09 Jul 2015 23:29:50 +0000
Subject: Bug #70037 [NEW]: PCRE_DOLLAR_ENDONLY fails on newlines when used with pipe operator
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194269@lists.php.net to get a copy of this message
From: chrisdmiddleton at gmail dot com Operating system: Mac OS X 10.9.4 PHP version: 5.6.10 Package: PCRE related Bug Type: Bug Bug description:PCRE_DOLLAR_ENDONLY fails on newlines when used with pipe operator Description: ------------ When trying to match newlines with the PCRE_DOLLAR_ENDONLY modifier in conjunction with the "|" operator, it matches more than it should. My original test case was using a regex of '/^\n|\r\n|\r$/D' against a string containing other characters. I've simplified the test below. Test script: --------------- echo preg_match('/^\n|\n$/D', "\nasdf", $matches); Expected result: ---------------- 0 Actual result: -------------- 1 -- Edit bug report at https://bugs.php.net/bug.php?id=70037&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70037&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70037&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70037&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70037&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70037&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70037&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70037&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70037&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70037&r=support Expected behavior: https://bugs.php.net/fix.php?id=70037&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70037&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70037&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70037&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70037&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70037&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70037&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70037&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70037&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70037&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70037&r=mysqlcfg

« previous php.bugs (#194269) next »