• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

jetheredge
#1 Posted : Friday, October 12, 2007 1:52:39 PM(UTC)
jetheredge

Rank: Member

Joined: 3/1/2006(UTC)
Posts: 1,142

In Bvc5 SP3 we are including support for zip code validation based on regular expressions. We are going to include a regular expression for U.S. zip codes, but we do not have the time to research all of the countries of the world and make regular expressions for their zip codes. This post is going to be for people to either post regular expressions for a country's postal code or to explain in layman's terms the format of a zip code in a particular country so that it can be translated into a regular expression. Here are two regex's for United States and Canada.

United States - ^\d{5}$
Canada - ^\D{1}\d{1}\D{1}\-?\d{1}\D{1}\d{1}$

(Also, I know that the regex for us zip codes only takes the 5 digits, but that is because some of the shipping services won't take a zip plus 5 code.)

Edited by user Friday, June 3, 2016 1:07:35 PM(UTC)  | Reason: Not specified

Justin Etheredge
Senior Software Engineer
BVSoftware
CorneliuTusnea
#2 Posted : Saturday, October 13, 2007 3:06:26 AM(UTC)
CorneliuTusnea

Rank: Member

Joined: 8/17/2006(UTC)
Posts: 681

Australia: 4 digits: I'd say the post code should be: ^\d{4}$ but don't take my word as RegExes are something I never managed to understand :)
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

Andy Miller
#3 Posted : Saturday, October 13, 2007 9:00:44 AM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
From the Regular Expression Library...


Portugese

Ethiopian

India, India

Canada, Canada, Canada

Germany, Germany, Germany

United Kingdom, United Kingdom

Brazil, Brazil

Netherland

Denmark

Russia

Switzerland

Australia






Jamie Zawinski said...
Some people, when confronted with a problem, think, "I know, I'll use regular expressions."

Now they have two problems.
[/quote]
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2025 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012