CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [ichi] Regular expression to extract domain name: Edit Log



Shree
Novice


Apr 27, 2009, 2:23 AM


Views: 4887
Re: [ichi] Regular expression to extract domain name

_______________________________________________________________________________

#!/usr/bin/perl
use strict;
use warnings;

my $url = "http://www.google.com/test/india/clickhandler.js";

my @arr = split(/\//,$url);

$arr[2] =~ s/^www.//;

print $arr[2];


_______________________________________________________________________________
Thanks
-Shree



(This post was edited by Shree on Apr 27, 2009, 2:26 AM)


Edit Log:
Post edited by Shree (Novice) on Apr 27, 2009, 2:24 AM
Post edited by Shree (Novice) on Apr 27, 2009, 2:25 AM
Post edited by Shree (Novice) on Apr 27, 2009, 2:26 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives