You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.5 KiB
41 lines
1.5 KiB
## @file
|
|
# Common regexp issued from Regexp::Common
|
|
|
|
package Lemonldap::NG::Common::Regexp;
|
|
|
|
use AutoLoader 'AUTOLOAD';
|
|
|
|
our $VERSION = '2.0.0';
|
|
|
|
1;
|
|
|
|
__END__
|
|
|
|
sub HOST {
|
|
qr{^(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)|.{0})$};
|
|
}
|
|
|
|
sub HOSTNAME {
|
|
qr{^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?|.{0})$};
|
|
}
|
|
|
|
sub HTTP_URI {
|
|
qr{^(?:https?://(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-9]*[a-zA-Z0-9]|[a-zA-Z])[.]?)|(?:[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)))(?::(?:(?:[0-9]*)))?(?:/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*)(?:/(?:(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)(?:;(?:(?:[a-zA-Z0-9\-_.!~*'():@&=+\$,]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*))*))*))(?:[?](?:(?:(?:[;/?:@&=+\$,a-zA-Z0-9\-_.!~*'()]+|(?:%[a-fA-F0-9][a-fA-F0-9]))*)))?))?|.{0})$};
|
|
}
|
|
|
|
sub reDomainsToHost {
|
|
my $list = shift;
|
|
return qr/^$/ unless ($list);
|
|
$list =~ s/^\./\\\./g;
|
|
$list = join( '|', split( /\s+/, $list ) );
|
|
return qr/^(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:$list)$/;
|
|
}
|
|
|
|
sub GOOGLEAXATTR {
|
|
return qr/^(?:(?:la(?:nguag|stnam)|firstnam)e|country|email)$/;
|
|
}
|
|
|
|
sub OPENIDSREGATTR {
|
|
return
|
|
qr/^(?:(?:(?:full|nick)nam|languag|postcod|timezon)e|country|gender|email|dob)$/;
|
|
}
|
|
|