regex puzzle
- From: zhao_bingfeng@xxxxxxxxxxxxx (Bingfeng Zhao)
- Date: Fri, 29 Jul 2005 13:48:15 +0800
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
- Prev by Date: need solution for writing a perl script
- Next by Date: RE: regex puzzle
- Previous by thread: need solution for writing a perl script
- Next by thread: RE: regex puzzle
- Index(es):