Gossamer Forum
Home : Products : Links 2.0 : Customization :

Parse URL

Quote Reply
Parse URL
Hi,

I was wondering if someone could help me with some code. I need to parse the url from yahoo that is currently like this:

http://srd.yahoo.com/drst/12345/*http://www.url.com

so it will end up like this:

http://www.url.com

So basically I need something to eliminate everything before and including the *

Thanks for the help!

Adam

PS: Assume that the yahoo url is in a variable $url

Last edited by:

anr: Dec 26, 2001, 7:02 PM
Quote Reply
Re: [anr] Parse URL In reply to
$link = $url =~ /\*(.*)$/;

--Philip
Links 2.0 moderator
Quote Reply
Re: [ThatPerson1024] Parse URL In reply to
Thanks for the help, but when I add this line, $link comes back with a 1 and not the url.
Quote Reply
Re: [anr] Parse URL In reply to
ugh...
my $link = $1 if $url =~ /\*(.*)$/;

--Philip
Links 2.0 moderator
Quote Reply
Re: [ThatPerson1024] Parse URL In reply to
Smile Perfect!

Thanks!
Quote Reply
Re: [anr] Parse URL In reply to
Or um....


$some_var =~ s,.+\*,,;