|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-28 23:41 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 09:00:02 2025 UTC |
Description: ------------ When using multiline mode in a regular expression, \s incorrectly matches a new-line character. Reproduce code: --------------- $info = <<<INFO Sender: Pages: 1 INFO; preg_match_all('/^\s*([^:]+?):\s*(.*)$/m', $info, $matches, PREG_PATTERN_ORDER); // combine into an array of key=>value pairs $info = array_combine(array_map('strtolower', $matches[1]), $matches[2]); var_dump($info); Expected result: ---------------- array(2) { ["sender"]=> string(0) "" ["pages"]=> string(1) "1" } Actual result: -------------- array(1) { ["sender"]=> string(8) "Pages: 1" }