RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 2
Title Test Details Email
Expression
^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
Description
regex to validate email address noteworthy: (1) It allows usernames with 1 or 2 alphanum characters, or 3+ chars can have -._ in the middle. username may NOT start/end with -._ or any other non alphanumeric character. (2) It allows heirarchical domain names (e.g. [email protected]). Similar -._ placement rules there. (3) It allows 2-9 character alphabetic-only TLDs (that oughta cover museum and adnauseum :>). (4) No IP email addresses though -- I wouldn't Want to accept that kind of address.
Matches
Non-Matches
Author Rating: The rating for this expression. Rob Eberhardt
Title Test Details USA Phone
Expression
^(\d)?[ ]*[\(\.\-]?(\d{3})[\)\.\-]?[ ]*(\d{3})[\.\- ]?(\d{4})[ ]*(x|ext\.?)?[ ]*(\d{1,7})?$
Description
Requires area code. Allows extension. Any common US format works. If you prefer not to require area code, use this: ^(\d)?[ ]*[\(\.\-]?(\d{3})?[\)\.\-]?[ ]*(\d{3})[\.\- ]?(\d{4})[ ]*(x|ext\.?)?[ ]*(\d{1,7})?$
Matches
1 (123) 123-1234 ext. 1234567 | 1 (123) 123-1234 | (123) 123-1234 | (123)123.1234 | 1-123-123-1234 | 1231231234
Non-Matches
123/1234 L. 12345678
Author Rating: Not yet rated. Rob Eberhardt
   Displaying page 1 of 1 pages; Items 1 to 2

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials