about summary refs log tree commit diff
path: root/perl/lib/Nix/Utils.pm
blob: 943b8dd4abfadf6003a6eb8d767877336537d3a1 (plain) (blame)
1
2
3
4
5
6
7
8
package Nix::Utils;

$urlRE = "(?: [a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*]+ )";

sub checkURL {
    my ($url) = @_;
    die "invalid URL ‘$url\n" unless $url =~ /^ $urlRE $ /x;
}