Created
October 22, 2012 19:21
-
-
Save fkumro/3933500 to your computer and use it in GitHub Desktop.
Sample URL validation with Regexp::Common
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Regexp::Common qw /URI/; | |
sub _is_valid_url | |
{ | |
my ($self, $url) = @_; | |
my $regexp = qr($RE{URI}{HTTP}{-scheme=>qr/https?/}{-keep}); | |
return 1 if ($url =~ $regexp); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for "https?".