Date: 08/10/01
- Next message: Rasmus Lerdorf: "[PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/sablot sablot.c"
- Previous message: Rubens Barroso: "[PHP-DEV] compile error on Win2000"
- In reply to: jax <email protected>: "[PHP-DEV] Bug #12688: preg_match doesn't return newlines in match array"
- Next in thread: jax <email protected>: "[PHP-DEV] Bug #12688 Updated: preg_match doesn't return newlines in match array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 12688
Updated by: alindeman
Reported By: jax <email protected>
Old Status: Open
Status: Bogus
Bug Type: *Regular Expressions
Operating System: FreeBSD 4.2
PHP Version: 4.0.6
New Comment:
add an "s" to the end of your reg exp.
if (preg_match('/Here(.*)$/s',$someline,$matches)){
^
this mean "treat everything as one line" and it will parse the
newline.
Previous Comments:
------------------------------------------------------------------------
[2001-08-10 02:20:48] jax <email protected>
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 this bug report at http://bugs.php.net/?id=12688&edit=1
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Rasmus Lerdorf: "[PHP-DEV] Re: [PHP-CVS] cvs: php4 /ext/sablot sablot.c"
- Previous message: Rubens Barroso: "[PHP-DEV] compile error on Win2000"
- In reply to: jax <email protected>: "[PHP-DEV] Bug #12688: preg_match doesn't return newlines in match array"
- Next in thread: jax <email protected>: "[PHP-DEV] Bug #12688 Updated: preg_match doesn't return newlines in match array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

