File Coverage

blib/lib/FormValidator/Lite/Constraint/URL.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package FormValidator::Lite::Constraint::URL;
2 1     1   593 use strict;
  1         1  
  1         36  
3 1     1   4 use warnings;
  1         1  
  1         26  
4 1     1   3 use FormValidator::Lite::Constraint;
  1         2  
  1         6  
5              
6             # this regexp is taken from http://www.din.or.jp/~ohzaki/perl.htm#httpURL
7             # thanks to ohzaki++
8             rule 'HTTP_URL' => sub {
9             $_ =~ /^s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+$/
10             };
11              
12             1;
13             __END__