Skip to content

Instantly share code, notes, and snippets.

@fkumro
Created October 22, 2012 19:21
Show Gist options
  • Save fkumro/3933500 to your computer and use it in GitHub Desktop.
Save fkumro/3933500 to your computer and use it in GitHub Desktop.
Sample URL validation with Regexp::Common
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;
}
@bem33
Copy link

bem33 commented Apr 5, 2017

Thanks for "https?".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment