Re: [PHP] preg_replace newb

2003-10-13 Thread Eugene Lee
On Mon, Oct 13, 2003 at 11:00:36PM +1000, Justin French wrote: : : On Monday, October 13, 2003, at 10:17 PM, Mohamed Lrhazi wrote: : : >I would try a petern like this: : > : >$pattern="!([^<]*)!" : > : >check the docs for greedy not greedy thingy... : : Mohamed, : : I still can't seem to get i

Re: [PHP] preg_replace newb

2003-10-13 Thread Justin French
Mohamed, I still can't seem to get it working: foo"; $str = preg_replace("!([^<]*)!",'blah',$str); echo $str; ?> echo's 'foo' rather than 'blah' Justin On Monday, October 13, 2003, at 10:17 PM, Mohamed Lrhazi wrote: I would try a petern like this: $pattern="!([^<]*)!" check the docs for gre

Re: [PHP] preg_replace newb

2003-10-13 Thread Mohamed Lrhazi
I would try a petern like this: $pattern="!([^<]*)!" check the docs for greedy not greedy thingy... Mohamed~ On Mon, 2003-10-13 at 06:27, Justin French wrote: > Hi, > > Trying to get this working, without any luck: > > $str = preg_replace("! href='(.*?)'>(.*?)!",'{link|\\2|\\1}',$str); > > F

[PHP] preg_replace newb

2003-10-13 Thread Justin French
Hi, Trying to get this working, without any luck: $str = preg_replace("!(.*?)!",'{link|\\2|\\1}',$str); FWIW, I'm aware that this doesn't ANY WHERE NEAR cover all instances of a link, but in this case, I KNOW that the link will have the above format, because it was generated by another PHP scr