Hi,
Really struggling to find a solution to this one :|
We have the following in a HTML extract, which I'm trying to replace with the value from $image_url (defined in another routine, but that's irrespective of the problem, as some of the URL's are being changed ok, but not others :/).
The HTML looks like;
<img width=588 height=381 src="35598-Science%20Coursework1_files/image002.gif">
<img width=28 height=28 src="35598-Science%20Coursework1_files/image003.gif">
..and the regex is;
$content =~ s|\Qsrc="\E(.*?)/(.*?)\"\>|src="$image_path/$2.$3">|sig;
There are 3 images in the sample HTML document I'm trying to process;
<img width=28 height=28 src="35598-Science%20Coursework1_files/image002.gif">
<img width=28 height=28 src="35598-Science%20Coursework1_files/image003.jpg">
The 001 and 003 images are being replaced correctly by the regex- but not the 002 image!
Can *anyone* see my obvious mistake. I'm loosing my haid over this one (what I've got left ;))
TIA!
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Really struggling to find a solution to this one :|
We have the following in a HTML extract, which I'm trying to replace with the value from $image_url (defined in another routine, but that's irrespective of the problem, as some of the URL's are being changed ok, but not others :/).
The HTML looks like;
<img width=588 height=381 src="35598-Science%20Coursework1_files/image002.gif">
<img width=28 height=28 src="35598-Science%20Coursework1_files/image003.gif">
..and the regex is;
$content =~ s|\Qsrc="\E(.*?)/(.*?)\"\>|src="$image_path/$2.$3">|sig;
There are 3 images in the sample HTML document I'm trying to process;
Quote:
<img width=588 height=381 src="35598-Science%20Coursework1_files/image001.gif"> <img width=28 height=28 src="35598-Science%20Coursework1_files/image002.gif">
<img width=28 height=28 src="35598-Science%20Coursework1_files/image003.jpg">
The 001 and 003 images are being replaced correctly by the regex- but not the 002 image!
Can *anyone* see my obvious mistake. I'm loosing my haid over this one (what I've got left ;))
TIA!
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates


Re: [Andy] Regex driving me *MAD*