#!/bin/perl -w use strict; use warnings; use Getopt::Long; my $address; my @args = @ARGV; print $args[0]."\n"; my $reg = '^(https?\://)?(www.|[a-zA-Z]+.)([a-zA-Z0-9]+((\.|\-)[a-zA-Z0-9])?)+\.(com|edu|gov|COM|EDU|GOV)(/($|[a-zA-Z0-9~\.]+))*$'; #actually the regex above are not 100 percent correct, can you find and modify it? my $str = $args[0]; if($str =~ m/($reg)/) {print "matched\n";} else {print "unmatched".$str;}