See following sample code:

<CODE>
use warnings;
use strict;
 
my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" );
 
for (@address)
{
    print "\"$_\" passed! \n" if /^((http|ftp):\/\/)?.+$/;
}
</CODE> 

the running result is:
"http://test"; is valid.
"http://"; is valid.
"www" is valid.
"ftp:/foo" is valid.

why "http://"; and "ftp:/foo" can pass the check?
 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to