Re: base domain parsing www.mydomain.com

2003-09-03 Thread David T-G
perl -- What an amazing coincidence ... Your parents named you in an idiosyncratic way which, amazingly, matches the language about which you now ask a question! ...and then perl said... % % Please help me parse this www.mydomain.com to just mydomain.com ... You've seen the replies noting tha

Re: base domain parsing www.mydomain.com

2003-09-02 Thread Tim Yohn
On Tue, 2003-09-02 at 12:54, perl wrote: > Please help me parse this www.mydomain.com to just mydomain.com > > Below are some scenarios in which all I want is the last two values, > mydomain.com : > > mydomain.com = mydomain.com > www.yourdomain.com = yourdomain.com > www.station.fire.org = fi

RE: base domain parsing www.mydomain.com

2003-09-02 Thread Hanson, Rob
Something like this should work... my $domain = 'www.station.fire.org'; if ($domain =~ /([^\.]+\.[^\.]+)$/) { print "$1\n"; } else { print "Failed to find domain\n"; } This is very lenient in the matching, so it should match all valid domain names as well as a lot of invalid ones. If th