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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<zip5>^\d{5})([\- ]?(?<plus4>\d{4})?$)
Description
Zip Code (Zip or Zip-Plus4 format). Accepts a hyphen, a space, or nothing between Zip and Plus4 segments. Named segments &lt;zip&gt; and &lt;plus4&gt; may be used to reformat users input to desired format using Regex replace function (re.replace).
Matches
92078 | 92078-4705 | 92078-4705
Non-Matches
9207 | 92078470 | 92078*4705
Author Rating: Not yet rated. MARK J KRISBURG
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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