Jun 30, 2008, 12:36 PM
Post #1 of 5
Simple RegEx Help! Please!
I'm going through a bunch of web content, and need to make all of the links relative, rather than hard-coded because I'm generating an archive to put on disk. So, instead of the link being to "/images/pic1.jpg", I want it to be "images/pic1.jpg".
I have the code ready to add before the "images" directory to make it relative. It stores the number of "../" in a variable called $path. For some reason, though, my regex doesn't work!
Basically, I want to replace anything like:
Currently, I have the following:
I've never claimed to be a RegEx pro, but I usually hack one up when I need it with great success....This one, I'm afraid, never works like I think it should!
Any help would be greatly appreciated!
(This post was edited by martygilbert on Jun 30, 2008, 12:44 PM)