Ethan Rosenberg wrote:
FYI [to all the list] -- I thank all for their input. I only needed US
phones, and I am forcing the user of the form to conform to xxx-xxx-
as the input format.
out of interest, why are you forcing you're users to conform to that
input format? you could simply
At 07:11 AM 12/31/2010, Nathan Rixham wrote:
Ethan Rosenberg wrote:
FYI [to all the list] -- I thank all for their input. I only
needed US phones, and I am forcing the user of the form to conform
to xxx-xxx- as the input format.
out of interest, why are you forcing you're users to
://www.ashleysheridan.co.uk
- Reply message -
From: Ethan Rosenberg eth...@earthlink.net
Date: Fri, Dec 31, 2010 14:03
Subject: [PHP] Regex for telephone numbers
To: Nathan Rixham nrix...@gmail.com
Cc: php-general@lists.php.net php-general@lists.php.net
At 07:11 AM 12/31/2010, Nathan Rixham wrote
my mobile as a means of contact.
Thanks,
Ash
http://www.ashleysheridan.co.ukhttp://www.ashleysheridan.co.uk
- Reply message -
From: Ethan Rosenberg eth...@earthlink.net
Date: Fri, Dec 31, 2010 14:03
Subject: [PHP] Regex for telephone numbers
To: Nathan Rixham nrix...@gmail.com
Cc: php
Ethan Rosenberg wrote:
At 07:11 AM 12/31/2010, Nathan Rixham wrote:
Ethan Rosenberg wrote:
FYI [to all the list] -- I thank all for their input. I only needed
US phones, and I am forcing the user of the form to conform to
xxx-xxx- as the input format.
out of interest, why are you
a...@ashleysheridan.co.uk wrote:
Sorry for top-post, on phone.
What about mobile phone numbers (cell phones you call them in the US)
do they conform to the same format?
AFAIK, they too vary from country to country. Swiss mobile numbers are
07[6789] NNN, the latter usually written as
On Fri, Dec 31, 2010 at 11:04, Per Jessen p...@computer.org wrote:
AFAIK, they too vary from country to country. Swiss mobile numbers are
07[6789] NNN, the latter usually written as NNN NN NN, but also
often in a way that will help remembering the number.
Danish mobile#s are the same as
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 Wed, 2010-12-29 at 19:35 -0500, 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
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.
On Dec 29, 2010, at 6:12 PM, Ethan Rosenberg wrote:
I would like to have a regex which would validate that a telephone
number is in the format xxx-xxx-.
http://lmgtfy.com/?q=regex+to+validate+US+phone+numbers
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
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 [Debian (sid)]
--
PHP General Mailing List
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-general@lists.php.net
Subject: [PHP] Regex for telephone numbers
Dear List -
Thank you
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
; php-general@lists.php.net
Subject: [PHP] Regex for telephone numbers
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
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
Why not have three separate fields for each part, as that way you don't
need to bother about how the user separates them, as trust me, if they
can break it, they will.
I have found it is best to always limit the amount of free entry you
permit a user, as that will drastically cut back in data
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
24 matches
Mail list logo