ID: 36900 Updated by: [EMAIL PROTECTED] Reported By: andrew dot minerd at sellingsource dot com -Status: Open +Status: Bogus Bug Type: PCRE related Operating System: Gentoo Linux PHP Version: 5.1.2 New Comment:
PHP doesn't parse regular expressions, it just wraps PCRELib. And if PCRELib behaves wrong - there is nothing we can do about it. Previous Comments: ------------------------------------------------------------------------ [2006-03-28 23:33:46] andrew dot minerd at sellingsource dot com 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" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36900&edit=1