Assuming protocol and all, it's pretty easy with Regexp::Common:
Your sample seems to omit the protocol and other bits that make a URI. Do you know they are all http? Try looking at the regex from R::C::URI and pick out the host-and-domain part. It will start with two literal slashes and run until the next slash or space, whichever comes first.use Regexp::Common qw/URI/; my @results; while ($string =~/$RE{URI}{-keep}/g) { push @results, $1; }
After Compline,
Zaxo
In reply to Re: Grepping out strings
by Zaxo
in thread Grepping out strings
by existem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |