|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-15 10:13 UTC] nlopess@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
Description: ------------ When i use preg_replace with the /u utf-8 modifier and an ungreedy search e.g. with *?, the result is different to a call without /u. Reproduce code: --------------- <?php echo "without /u:". preg_replace('/^[^d]*?(d)?$/', '\\1', 'abc'); echo "<br>"; echo "with /u: ".preg_replace('/^[^d]*?(d)?$/u', '\\1', 'abc'); ?> Expected result: ---------------- without /u: with /u: Actual result: -------------- without /u: with /u: abc