Re: PHP 4.0 Bug #6046 Updated: preg_replace for a special pattern
| From: | Wico de Leeuw | Date: | Mon, 22 Jan 2001 09:00:55 +0000 |
| Subject: | Re: PHP 4.0 Bug #6046 Updated: preg_replace for a special pattern | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-44695@lists.php.net to get a copy of this message | ||
At 08:18 21-1-01 +0000, Bug Database wrote:
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.Sometimes you can't like ([0-9]?(?(1))[a-z]) Now you need to capture Greetz, Wico
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