Here is a link with base rules for perl regex
http://www.anaesthetist.com/mnm/perl/regex.htm . Anyway some time ago I developed my sript for parsing url.
So here is the code:
$url="http://www.webmasterstalks.com";
$url =~ m|(\w+)://([^/:]+)(:\d+)?/(.*)|;
$protocol = $1;
$domainName = $2;
$uri = "/" . $4;
if ($3 =~ /:(\d+)/) { $portNo = $1} else { $portNo = 80}
#print $domainName."\n";
($host,$domain) = $domainName =~ /^([^\.]+)\.(.*)$/;
my $tld_re = qr/( \w+ )/x;
Happy ?
Regards