|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-29 00:29 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Description: ------------ In preg_match (and preg_replace), vertical tab character matches characters other than itself. At the least, it matches ascii 10,11,12,13 and 133, when it should only match 11. (Vertical tab has been nixed from PCRE - is that the cause?) Reproduce code: --------------- $wrong = chr(133); //can use any of 10,12,13 or 133 $x = preg_match('/\v/', $wrong, $matches, PREG_OFFSET_CAPTURE); var_dump($matches); $right = chr(11); $x = preg_match('/\v/', $right, $matches, PREG_OFFSET_CAPTURE); var_dump($matches); Expected result: ---------------- array empty array 0 => array 0 => string '' (length=1) 1 => int 0 Actual result: -------------- array 0 => array 0 => string '�' (length=1) 1 => int 0 array 0 => array 0 => string '' (length=1) 1 => int 0