Gossamer Forum
Home : General : Perl Programming :

Regex headache

Quote Reply
Regex headache
Okay, admittedly I am not the greatest with regexs but I should have been able to figure this out. In short I am using LWP to download images on a page and then I have Image::Magick resizing them. My problem comes when I have an image to download that is relative to the URL for instance:

The page I want to "spider" is at

http://www.domain.com/...s/that/whatever.html

The tags on that page look like this:

<img src="../image.gif">

Basically I need a regex to take

http://www.domain.com/...s/that/whatever.html

and turn it into

http://www.domain.com/1/two/this/

so the image can be grabbed. Like I said, I am terrible with regexes so this is probably something simple...
Subject Author Views Date
Thread Regex headache BennyHill 5911 Jun 30, 2003, 6:08 PM
Post Re: [BennyHill] Regex headache
Andy 5823 Jul 1, 2003, 1:42 AM
Thread Re: [BennyHill] Regex headache
adrockjames 5815 Jul 1, 2003, 8:42 AM
Post Re: [adrockjames] Regex headache
Paul 5785 Jul 1, 2003, 8:49 AM
Post Re: [BennyHill] Regex headache
diesel 5787 Jul 1, 2003, 2:09 PM