|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2007-08-15 08:43 UTC] jani@php.net
  [2007-08-15 09:02 UTC] nlopess@php.net
  [2007-09-01 17:54 UTC] nlopess@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 05:00:02 2025 UTC | 
Description: ------------ When using the /u modifier, preg_match, preg_match_all, and preg_replace all give incorrect results using /\S{2}/u but work fine with /\S\S/u which should be equivalent. Reproduce code: --------------- $s = "A\xc2\xa3BC"; preg_match_all('/\S\S/u', $s, $m); print_r($m[0]); preg_match_all('/\S{2}/u', $s, $m); print_r($m[0]); Expected result: ---------------- Array ( [0] => A£ [1] => BC ) Array ( [0] => A£ [1] => BC ) Actual result: -------------- Array ( [0] => A£ [1] => BC ) Array ( [0] => A [1] => )