Bug #75069 [NEW]: preg_match function wrong result

From: Date: Sun, 13 Aug 2017 13:07:56 +0000
Subject: Bug #75069 [NEW]: preg_match function wrong result
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210649@lists.php.net to get a copy of this message
From: bublik dot drdrdr at gmail dot com Operating system: Windows PHP version: 7.1.8 Package: *Regular Expressions Bug Type: Bug Bug description:preg_match function wrong result Description: ------------ preg_match finds a wrong match with these params: pattern "(?=.*?[A-Za-z]).{8,}", subject "вasdaв". Last contains 6 chars (english and russian), but regex pattern must accept only 8+ chars. Test script: --------------- $out = array(); preg_match("/(?=.*?[A-Za-z]).{8,}/", "вasdaв", $out); var_dump($out); Expected result: ---------------- array(0) { } Actual result: -------------- array(1) { [0]=> string(8) "вasdaв" } -- Edit bug report at https://bugs.php.net/bug.php?id=75069&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75069&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75069&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75069&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75069&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75069&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75069&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75069&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75069&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75069&r=support Expected behavior: https://bugs.php.net/fix.php?id=75069&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75069&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75069&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75069&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75069&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75069&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75069&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75069&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75069&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75069&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75069&r=mysqlcfg

« previous php.bugs (#210649) next »