Bug #12688: preg_match doesn't return newlines in match array

From: Date: Fri, 10 Aug 2001 06:20:48 +0000
Subject: Bug #12688: preg_match doesn't return newlines in match array
Groups: php.dev 
Request: Send a blank email to php-dev+get-62775@lists.php.net to get a copy of this message
From:             jax@uia.net
Operating system: FreeBSD 4.2
PHP version:      4.0.6
PHP Bug Type:     *Regular Expressions
Bug description:  preg_match doesn't return newlines in match array

This is not a core dump, but rather an output problem with preg_match. 
Here is a short script:

$someline = "Here is some line.\n";
if ( preg_match('/Here(.*)$/',$someline,$matches) ) {
  $out = $matches[1];
}

print "<pre>[$out]</pre>";

$out now contains no newline when this clearly should be included!

--Liam
-- 
Edit bug report at: http://bugs.php.net/?id=12688&edit=1



Thread (5 messages)

« previous php.dev (#62775) next »