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 US ZIP codes with valid prefixes
Expression
(?!00[02-5]|099|213|269|34[358]|353|419|42[89]|51[789]|529|53[36]|552|5[67]8|5[78]9|621|6[348]2|6[46]3|659|69[4-9]|7[034]2|709|715|771|81[789]|8[3469]9|8[4568]8|8[6-9]6|8[68]7|9[02]9|987)\d{5}
Description
This matches all 5 digit numbers whose first three digits match valid US ZIP code prefixes.
Matches
10038 11205 20723
Non-Matches
09911 26942 98763
Author Rating: The rating for this expression. Brandon Schlueter
Title Test Details US ZIP and ZIP+4 codes with valid prefixes
Expression
(?!00[02-5]|099|213|269|34[358]|353|419|42[89]|51[789]|529|53[36]|552|5[67]8|5[78]9|621|6[348]2|6[46]3|659|69[4-9]|7[034]2|709|715|771|81[789]|8[3469]9|8[4568]8|8[6-9]6|8[68]7|9[02]9|987)\d{5}(-\d{4}){0,1}
Description
Matches all US ZIP and ZIP+4 codes with vaild prefixes.
Matches
10038 11205 20723 12345-1222
Non-Matches
09911 26942 98763 12345-122
Author Rating: Not yet rated. Brandon Schlueter
   Displaying page 1 of 1 pages; Items 1 to 2

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