|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2018-09-19 06:28 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2018-09-19 06:28 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 13:00:02 2026 UTC |
Description: ------------ `mb_ereg`, `mb_ereg_search_regs` & `mb_ereg_search_getregs` return only numbered capturing groups, but they should return both numbered and named capturing groups. Test script: --------------- mb_regex_encoding("UTF-8"); mb_ereg('(?<wsp>\s*)(?<word>\w+)', ' 中国', $m); var_dump($m); mb_ereg_search_init(' 中国?'); mb_ereg_search('(?<wsp>\s*)(?<word>\w+)(?<punct>[?!])'); var_dump(mb_ereg_search_getregs()); Expected result: ---------------- array(5) { [0]=> string(8) " 中国" [1]=> string(2) " " [2]=> string(6) "中国" ["wsp"]=> string(2) " " ["word"]=> string(6) "中国" } array(7) { [0]=> string(11) " 中国?" [1]=> string(2) " " [2]=> string(6) "中国" [3]=> string(3) "?" ["punct"]=> string(3) "?" ["wsp"]=> string(2) " " ["word"]=> string(6) "中国" } Actual result: -------------- array(3) { [0]=> string(8) " 中国" [1]=> string(2) " " [2]=> string(6) "中国" } array(4) { [0]=> string(11) " 中国?" [1]=> string(2) " " [2]=> string(6) "中国" [3]=> string(3) "?" }