Bug #13439: unbound .* patterns don't work properly
| From: | john at scl dot co dot uk | Date: | Tue, 25 Sep 2001 18:41:40 +0000 |
| Subject: | Bug #13439: unbound .* patterns don't work properly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-66581@lists.php.net to get a copy of this message | ||
From: john@scl.co.uk
Operating system:
PHP version: 4.0.5
PHP Bug Type: *Regular Expressions
Bug description: unbound .* patterns don't work properly
These 2 are OK:
ereg_replace('..','b','aa') -> b
ereg_replace('.+','b','aa') -> b
But this is wrong:
ereg_replace('.*','b','aa') -> bb
You can "fix" it by binding to the beginning:
ereg_replace('^.*','b','aa') -> b
but not by binding to the end:
ereg_replace('.*$','b','aa') -> bb
--
Edit bug report at: http://bugs.php.net/?id=13439&edit=1