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 1
Title Test Details Pattern Title
Expression
^[0-9]{5}([\s-]{1}[0-9]{4})?$
Description
My first Expression. This will match US postal codes (zip codes) using simple 5 digit format with optional 4 digit extention seperated by a space or hyphen. Will not accept letters. example: 12345 or 12345-1234 or 12345 1234.
Matches
12345-1234 | 12345 | 12345 1234
Non-Matches
123451234 | 12345 a345 | a2345-1234
Author Rating: Not yet rated. Ed Stafford
   Displaying page 1 of 1 pages; Items 1 to 1

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