Re: regex puzzle

2005-07-29 Thread Tom Allison
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):\/\/)?.+$/; # ^

Re: regex puzzle

2005-07-29 Thread Pedro Henrique Calais
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

Re: regex puzzle

2005-07-29 Thread Roberto Ruiz
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):\/\/)?.+$/; # ^

Re: regex puzzle

2005-07-29 Thread Flemming Greve Skovengaard
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

RE: regex puzzle

2005-07-29 Thread bingfeng zhao
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