OverlordQ has asked for the wisdom of the Perl Monks concerning the following question:
$url contains the orginal URL which was grabbed. Here-in lies the problem:$text =~ s#src=\"(.*?)\"#src=\"$url$1\"#sig;
http://www.slashdot.org/image.gifit get's changed into:
http://www.slashdot.orghttp://www.slashdot.org/image.gifbut if the url was a relative url:
image.gifbecomes:
http://www.slashdot.org/image.gifwhich works. So my question/problem, is there any way to get the regex to ignore absolute urls?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Help with Regex: (Absolute/Relative URLs)
by merlyn (Sage) on Aug 05, 2003 at 21:04 UTC | |
by OverlordQ (Hermit) on Aug 05, 2003 at 21:52 UTC | |
|
Re: Help with Regex: (Absolute/Relative URLs)
by Abigail-II (Bishop) on Aug 05, 2003 at 21:41 UTC | |
by OverlordQ (Hermit) on Aug 05, 2003 at 21:48 UTC |