Re: Regex for telephone numbers

From: Date: Sat, 01 Jan 2011 00:36:18 +0000
Subject: Re: Regex for telephone numbers
References: 1 2 3  Groups: php.db php.general 
Request: Send a blank email to php-general+get-310439@lists.php.net to get a copy of this message
On Fri, Dec 31, 2010 at 19:09, Jim Lucas <lists@cmsws.com> wrote: > > Actually... > > Specified here [1] it says that the {1,} is the same as '+'.  I think you should > drop the comma.  If you don't this would be valid 844-2345-123456 > > ^[2-9]{1,}[0-9]{2,}\-[2-9]{1,}[0-9]{2,}\-[0-9]{4,}$ > > should be > > ^[2-9]{1}[0-9]{2}\-[2-9]{1}[0-9]{2}\-[0-9]{4}$ Bah, you're absolutely correct. Force of habit with the commas. I didn't even notice the sample test cases I put into that test array didn't check for more than the number of digits per field, either. Good catch, Jim, and Happy New Year. -- </Daniel P. Brown> Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/

« previous php.general (#310439) next »