urgent !!! Please Help preg_replace !!!!!!!!!!!!!!!!!!!!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?
//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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux