Skip to content

Instantly share code, notes, and snippets.

View bem33's full-sized avatar

Emmanuel Bataille bem33

  • Paris, France
  • 16:16 (UTC +02:00)
View GitHub Profile
@fkumro
fkumro / Regexp::Common URI
Created October 22, 2012 19:21
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);