<p>I thought people would be working on little code projects together, but I don't see them, so here's an easy one:</p>

<p>Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so you might want to use weak validation.</p>

<p>I wrote a little bit about zip codes in a side project on my wiki/blog:</p>

<p><a href="https://benc.fogbugz.com/default.asp?W24" rel="nofollow noreferrer">https://benc.fogbugz.com/default.asp?W24</a></p>

<p>There is also a new, weird type of zip code. </p>

<p><a href="https://benc.fogbugz.com/default.asp?W42" rel="nofollow noreferrer">https://benc.fogbugz.com/default.asp?W42</a></p>

<p>I can do the javascript code, but it would be interesting to see how many languages we can get here.</p>

Javascript Regex Literal
:
US Zip Codes:
```
/(^\d{5}$)|(^\d{5}-\d{4}$)/
```
```
```
var isValidZip = /(^\d{5}$)|(^\d{5}-\d{4}$)/.test("90210");
```
```
Some countries use
Postal Codes
, which would fail this pattern.