Re: Phone number regexp

Armando Colpa <[email protected]> Tue, 11 May 2004 13:27:20 -0700 (PDT)
Newsgroups gmane.comp.jakarta.regexp.user
Message-ID <[email protected]>
The following works on my php instance. It's a
posix-standard regex, so it should work with any regex
package that's posix standards compliant.

AC

^([(]?\d{3}[-)]\d{3}-\d{4})*$
--- [email protected] wrote:
> 
> Hello!
> 
> I'm having trouble building a regexp pattern for a
> US telephone number.
> The following formats need to be valid:
> 
> <blank>
> xxx-xxx-xxxx
> (xxx)xxx-xxxx
> 
> 
> So, I need a blank and two number formats to be
> valid formats.  What's the
> regexp format that could accomplish this?
> 
> Thank you very much!!
> 
> -Ryan
> 
> 
> 
> 
> 
>
==============================================================================
> This communication, together with any attachments
> hereto or links contained herein, is for the sole
> use of the intended recipient(s) and may contain
> information that is confidential or legally
> protected. If you are not the intended recipient,
> you are hereby notified that any review, disclosure,
> copying, dissemination, distribution or use of this
> communication is STRICTLY PROHIBITED.  If you have
> received this communication in error, please notify
> the sender immediately by return e-mail message and
> delete the original and all copies of the
> communication, along with any attachments hereto or
> links herein, from your system.
>
==============================================================================
> The St. Paul Travelers e-mail system <tdmmsws2> made
> this annotation on 05/11/2004 04:17:55 PM.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [email protected]
> For additional commands, e-mail:
> [email protected]
> 


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover