|
Posted by David Grant on 12/06/05 13:04
Replace the middle (.*) with ([^<]*). This tells the regex engine to
ignore new opening tags.
Cheers,
David
Georgi Ivanov wrote:
> Hi,
> I want to replace the content of html links : <a href="foo"
> name="bla">REPLACETHIS</a>.
>
> $html=preg_replace("/(<a.*name=.*>)(.*)<\/a>/isU",$link,$html,1);
> This generally works but removes <a>,</a> tags too.
> How to make it work without removing anything else than (.*) in the middle of
> <a>.*</a>
>
> Thanks in advance.
>
--
David Grant
http://www.grant.org.uk/
Navigation:
[Reply to this message]
|