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 img src=path/to/image.jpg I want to change it to this img src=http://www.domain.com/path/to/image.jpg; BUT if the image tag is like this img src=http://www.domain.com/path/to/image.jpg;

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

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 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, December 19, 2002 6:18 AM Subject: [PHP] RegExpres Prob I