Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Getting only the link in a line

by poolpi (Hermit)
on Nov 04, 2010 at 10:20 UTC ( #869427=note: print w/ replies, xml ) Need Help??


in reply to Getting only the link in a line

See Regexp::Common::URI::http

#!/usr/bin/perl use strict; use warnings; use Regexp::Common qw /URI/; while(<DATA>){ chomp; /$RE{URI}{HTTP}{-keep}/ and print "Contains an HTTP URI.\nHost=$3\n"; } __DATA__ http://192.168.1.10/index.html http://www.delicious.com/search?p=perl&chk=&context=main|&fr=del_icio_ +us&lc=

Output:
Contains an HTTP URI.
Host=192.168.1.10
Contains an HTTP URI.
Host=www.delicious.com


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb


Comment on Re: Getting only the link in a line
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://869427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2015-07-30 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls