#!/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
In reply to Re: Getting only the link in a line
by poolpi
in thread Getting only the link in a line
by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |