Postal Code

Validate the structural format of an Iranian postal code (کد پستی): 10 digits, not starting with zero, and not a single digit repeated 10 times — after normalizing Persian/Arabic-Indic digits.

Last updated January 1, 1980

Overview

Installation

Usage

import { isValidPostalCode } from "@/lib/postal-code"
 
isValidPostalCode("1985813151") // true
isValidPostalCode("0000000000") // false

API Reference

postal-code