Re: Exact string replacement...
| From: | Brian Clark | Date: | Sat, 09 Feb 2002 08:01:40 +0000 |
| Subject: | Re: Exact string replacement... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-84088@lists.php.net to get a copy of this message | ||
* Desikan (desikb4u@fastmail.fm) [Feb 09. 2002 02:52]:
> hi Thanks,
Sure,
> But I want to do thr replace operation for
> regular exprerssion and not exactly for the string alone...
> like ----> ^and$,a*, etc....
<?php
$string = 'foo';
print preg_replace("/^\s$string\s/",' ',' foo foobar.') .
"\n";
print eregi_replace("^[[:space:]]".$string."[[:space:]]",' ','
foo foobar.') . "\n";
?>
I like the top better..
--
Headers set. CCs on list replies -> bit bucket.
Brian Clark | Unable to leap tall buildings in a single bound.
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8