Re: [PHP] RegExpres Prob

2002-12-19 Thread 1LT John W. Holmes
Why use a regular expression? $new_string = str_replace('img src="','img src="http://www.domain.com/',$old_string); ---John Holmes... - Original Message - From: "John Wards" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday

Re: [PHP] RegExpres Prob

2002-12-19 Thread Wico de Leeuw
At 11:27 19-12-02 +, John Wards wrote: On Thursday 19 Dec 2002 11:25 am, Wico de Leeuw wrote: Preg_Replace('~src="(?!http://)~iS', 'src="http://www.domain.com/', $string); 1. find src=" 2. look forward if next chars are http:// i=not case sensitive S=optimize pattern because we going to use

Re: [PHP] RegExpres Prob

2002-12-19 Thread John Wards
On Thursday 19 Dec 2002 11:25 am, Wico de Leeuw wrote: Preg_Replace('~src="(?!http://)~iS', 'src="http://www.domain.com/', $string); Ha! Ta I am all for quick fixes but I am new to RegExpresions...so could someone explain what its all doing for me. Cheers John -- PHP General Maili

Re: [PHP] RegExpres Prob

2002-12-19 Thread Wico de Leeuw
At 11:18 19-12-02 +, John Wards wrote: I have a regexp problem I want to go through some HTML and where I want to change it to this http://www.domain.com/path/to/image.jpg";> BUT if the image tag is like this http://www.domain.com/path/to/image.jpg";> already I don't want anything to hap

[PHP] RegExpres Prob

2002-12-19 Thread John Wards
I have a regexp problem I want to go through some HTML and where I want to change it to this http://www.domain.com/path/to/image.jpg";> BUT if the image tag is like this http://www.domain.com/path/to/image.jpg";> already I don't want anything to happen I thought this would do it: