PHP 4.0 Bug #6046 Updated: preg_replace for a special pattern
| From: | cynic@php.net | Date: | Sun, 21 Jan 2001 08:18:48 +0000 |
| Subject: | PHP 4.0 Bug #6046 Updated: preg_replace for a special pattern | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44662@lists.php.net to get a copy of this message | ||
ID: 6046
Updated by: cynic
Reported By: wico@cnh.nl
Old-Status: Open
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:
use non-capturing patterns.
Previous Comments:
---------------------------------------------------------------------------
[2000-08-09 07:41:24] wico@cnh.nl
hiya
if you have a regex that captures more than one pattern i'd to give a argument to the function
which to replace
say:
regex: (a)(b)(a)
replace: test
preg_replace("'(a)(b)(a)'", "test", "abaabaaba");
normal preg_replace will replace 'aba' with 'test' outputing: testtesttest
preg_replace_pattern_no("'(a)(b)(a)'", "test", "abaabaaba",
2);
replacing pattern 2 and outputting: atestaatestaatesta
Greetz,
Wico
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6046