Re: [PHP] Re: Changing URLs from Relative to Absolute

2007-07-30 Thread Richard Lynch
> Tom Chubb wrote: >> Dear list, >> I was recently trying to write a script where a user copy and pastes >> their >> HTML code to display something on a listings site and tried to find >> a way to >> change the URL of an image from relative to absolute. >> For example becomes http://domain.com/ima

[PHP] Re: Changing URLs from Relative to Absolute

2007-07-30 Thread Al
In general, you must have patterns and code that deal with most common errors. As to your example, your regex pattern must not be good. Is your complete string simply: ? If so, then "%src\x20*=\x20*\"*([\w/]+\x2Ejpg)%i" should do it for you. \x20*, may have 0 or more spaces; \x2E = period; "()