<? //please run this script, you can get what problem i got $html = <<<eof <a href="aaa.html">aaa</a> <a href="bbb.html">cfdfd</a> <a href="aaa.html">sfs sfsrbbb sfds</a> <a href="aaa.html">cc gd c</a> <a href="aaa.html">ddd 123</a> eof; /* i want replace any |<a.has bbb.</a>|, like <a href="bbb.html">cfdfd</a> <a href="aaa.html">sfs sfsrbbb sfds</a> */ $s[] = "|<a.*?(?!</a>).*?bbb.*?</a>|si"; $r[] = "X"; print preg_replace($s, $r, $html); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php