Javascript Regex Literal:
US Zip Codes: /(^d{5}$)|(^d{5}-d{4}$)/
/(^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.
1.4m articles
1.4m replys
5 comments
57.0k users