Hello Desikan, this should suit your needs.
<? $string = "Is this is a way of getting strings containing \"is\" dismissed from the string? It IS"; $pattern = "is"; $string = preg_replace("/(^|\s|[^a-z])" . $pattern . "($|\s|[^a-z])/is", "$1$2", $string); echo $string; ?> ~James > Please help me out in the following... > > <?php > $is='is'; > echo eregi_replace(" ".$is." "," ","This is a test string which contains > is in dismissal"); > ?> > > > Actually I want to replace "is" alone from the string and not all the > words that contains is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php