List Info

Thread: Regex for Phone Number and extension




Regex for Phone Number and extension
country flaguser name
United States
2007-07-25 12:23:05
I'm a Regex noob and need to figure out the Regex for a
phone number
with an extension.  The client wants it formatted very
specifically,
like this:

800.123.4567 ext.456

The phone number will always be 3 digits, then a period,
then 3
digits, another period, then 4 digits.  The phone number
should be
followed by a space, then "ext" then a period,
then a series of
numbers, maybe 1-6 digits long.

How can I make this happen?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: Regex for Phone Number and extension
user name
2007-07-26 00:29:01
I am also a regex noob..

[0-9].[0-9].[0-9]sext.[0-9]{1,6}
may do the work. Not tested fully. This can be made small by using subexpressions( I think so)
Hope this helps..

Regards,
  Lloyd

On 7/25/07, mrandolph < mrand01gmail.com">mrand01gmail.com> wrote:

I'm a Regex noob and need to figure out the Regex for a phone number
with an extension.  ;The client wants it formatted very specifically,
like this:

800.123.4567 ext.456

The phone number will always be 3 digits, then a period, then 3
digits, another period, then 4 digits.&nbsp; The phone number should be
followed by a space, then "ext&quot; then a period, then a series of
numbers, maybe 1-6 digits long.

How can I make this happen?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )