[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-31 Thread Daniel P. Brown
On Fri, Dec 31, 2010 at 19:09, Jim Lucas 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-

[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-31 Thread Jim Lucas
On 12/29/2010 4:35 PM, Daniel P. Brown wrote: > On Wed, Dec 29, 2010 at 19:12, Ethan Rosenberg wrote: >> Dear List - >> >> Thank you for all your help in the past. >> >> Here is another one >> >> I would like to have a regex which would validate that a telephone number >> is in the format xxx

[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-31 Thread Daniel Brown
On Fri, Dec 31, 2010 at 12:05, Dmitriy Ugnichenko wrote: > I guess, this will work fine > > ereg('[0-9]{3}-[0-9]{3}-[0-9]{4}',  $phone_number); Not quite. Plus, all ereg* functions have been deprecated for some time now. -- Network Infrastructure Manager Documentation, Webmaster Teams htt

[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-31 Thread Dmitriy Ugnichenko
I guess, this will work fine ereg('[0-9]{3}-[0-9]{3}-[0-9]{4}', $phone_number); On Thu, Dec 30, 2010 at 2:12 AM, Ethan Rosenberg wrote: > Dear List - > > Thank you for all your help in the past. > > Here is another one > > I would like to have a regex which would validate that a telephone

Re: [PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-30 Thread Daniel Brown
On Thu, Dec 30, 2010 at 14:07, Ethan Rosenberg wrote: > > Josh - > > I used use \d{3}-\d{3}-\d{4}. > > It works beautifully!! Just keep in mind that invalid numbers will also pass that check, such as 000-000- or 123-456-6789. That's why my example was a bit more involved. -- Network I

[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-30 Thread Ethan Rosenberg
At 07:27 PM 12/29/2010, Josh Kehn wrote: On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg wrote: > Dear List - > > Thank you for all your help in the past. > > Here is another one > > I would like to have a regex which would validate that a telephone number is in the format xxx-xxx-. >

[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-29 Thread Daniel P. Brown
On Wed, Dec 29, 2010 at 19:12, Ethan Rosenberg wrote: > Dear List - > > Thank you for all your help in the past. > > Here is another one > > I would like to have a regex  which would validate that a telephone number > is in the format xxx-xxx-. Congrats. People in Hell would like ice

Re: [PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-29 Thread Karl DeSaulniers
You could also help them out a little with something like.. $phone = str_replace("(", "", $phone); $phone = str_replace(")", "-", $phone); HTH, Karl On Dec 29, 2010, at 6:27 PM, Josh Kehn wrote: On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg wrote: Dear List - Thank you for all your

Re: [PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-29 Thread Karl DeSaulniers
Hi Ethan, Could you do a string compare and check at certain characters for a dash? IE: check the second character to see if it is a dash for 1-800... if that is not a dash, check the fourth character for a dash, 469-9... then the other places where dashes would be based on those two charact

[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-29 Thread Josh Kehn
On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg wrote: > Dear List - > > Thank you for all your help in the past. > > Here is another one > > I would like to have a regex which would validate that a telephone number is > in the format xxx-xxx-. > > Thanks. > > Ethan > > MySQL 5.1

[PHP-DB] RE: [PHP] Regex for telephone numbers

2010-12-29 Thread admin
Also remove your stupid Email filter. If you need a email filter, you should not be on this list or learn to setup rules one. Richard L. Buskirk -Original Message- From: Ethan Rosenberg [mailto:eth...@earthlink.net] Sent: Wednesday, December 29, 2010 7:12 PM To: php-db-lists.php.net; p

[PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-29 Thread Simon J Welsh
On 30/12/2010, at 1:12 PM, Ethan Rosenberg wrote: > Dear List - > > Thank you for all your help in the past. > > Here is another one > > I would like to have a regex which would validate that a telephone number is > in the format xxx-xxx-. > > Thanks. > > Ethan > > MySQL 5.1 PHP 5

[PHP-DB] RE: [PHP] Regex for telephone numbers

2010-12-29 Thread admin
I suggest you try javascript. Richard L. Buskirk -Original Message- From: Ethan Rosenberg [mailto:eth...@earthlink.net] Sent: Wednesday, December 29, 2010 7:12 PM To: php-db-lists.php.net; php-gene...@lists.php.net Subject: [PHP] Regex for telephone numbers Dear List - Thank you for