Re: [PHP] help with preg_replace only part of the string

2005-12-06 Thread David Grant
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=blaREPLACETHIS/a. $html=preg_replace(/(a.*name=.*)(.*)\/a/isU,$link,$html,1); This generally

Re: [PHP] help with preg_replace only part of the string

2005-12-06 Thread Richard Heyes
Georgi Ivanov wrote: Hi, I want to replace the content of html links : a href=foo name=blaREPLACETHIS/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

Re: [PHP] help with preg_replace only part of the string

2005-12-06 Thread Miles Thompson
At 07:06 AM 12/6/2005, Richard Heyes wrote: Georgi Ivanov wrote: Hi, I want to replace the content of html links : a href=foo name=blaREPLACETHIS/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