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 eth...@earthlink.netwrote:
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
On Fri, Dec 31, 2010 at 12:05, Dmitriy Ugnichenko
mitya.ugniche...@gmail.com 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.
--
/Daniel P. Brown
Network Infrastructure
On 12/29/2010 4:35 PM, Daniel P. Brown wrote:
On Wed, Dec 29, 2010 at 19:12, Ethan Rosenberg eth...@earthlink.net 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
On Fri, Dec 31, 2010 at 19:09, Jim Lucas li...@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
At 07:27 PM 12/29/2010, Josh Kehn wrote:
On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg eth...@earthlink.net 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
On Thu, Dec 30, 2010 at 14:07, Ethan Rosenberg eth...@earthlink.net 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.
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
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 Linux
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;
On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg eth...@earthlink.net 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
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
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 eth...@earthlink.net
wrote:
Dear List -
Thank you
On Wed, Dec 29, 2010 at 19:12, Ethan Rosenberg eth...@earthlink.net 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
13 matches
Mail list logo