Roberto Ruiz wrote:
On Fri, Jul 29, 2005 at 01:48:15PM +0800, bingfeng zhao wrote:
See following sample code:
my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" );
for (@address)
{
print "\"$_\" passed! \n" if /^((http|ftp):\/\/)?.+$/;
# ^
ED]>
To:
Sent: Friday, July 29, 2005 6:52 AM
Subject: Re: regex puzzle
On Fri, Jul 29, 2005 at 01:48:15PM +0800, bingfeng zhao wrote:
See following sample code:
my @address = ("http://test";, "http://";, "www
On Fri, Jul 29, 2005 at 01:48:15PM +0800, bingfeng zhao wrote:
> See following sample code:
>
> my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" );
>
> for (@address)
> {
> print "\"$_\" passed! \n" if /^((http|ftp):\/\/)?.+$/;
# ^
bingfeng zhao wrote:
See following sample code:
use warnings;
use strict;
my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" );
for (@address)
{
print "\"$_\" passed! \n" if /^((http|ftp):\/\/)?.+$/;
}
the running result is:
"http://test"; is valid.
"http://"; is vali
Oh, bug,it should be
use warnings;
use strict;
my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" );
for (@address)
{
print "\"$_\" is valid. \n" if /^((http|ftp):\/\/)?.+$/;
}
|-Original Message-
|From: bingfeng zhao [mailto:[EMAIL PROTECTED]
|Sent: Friday, J