use strict; use warnings; use Regexp::Common qw /URI/; my $string = "xxx http://perlmonks.com yyy http://foo.mp3 zzz"; $_ = $string; my @urls = grep {/\.mp3$/} /($RE{URI}{HTTP})/g; local $" = "\n"; print "@urls\n"; OutPUT: http://foo.mp3
This approach should find all valid http url's with no false matches while saving your hair.
In reply to Re: Simple regrep question
by BillKSmith
in thread Simple regrep question
by monkeybus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |