parseVehiclePlate
function parseVehiclePlate(plate): | VehiclePlate | null;Defined in: vehicle.ts:37
Splits a Pakistani vehicle registration number into its series letters,
number and optional year, e.g. LEA-1234 or ABC 123.
There is no single national format: each province’s excise department sets
its own, and several changed in 2024–2026 (numbers that stay with the
owner, new series). This accepts the common shape shared by all of them:
1–4 letters, then 1–4 digits, optionally followed by the two-digit year
that older Punjab plates carry (LEA-1234-19). Series letters are not
checked against a list of districts, as no official list is published.
Pass the registration number only, without labels such as “ICT” or
“PUNJAB” printed elsewhere on the plate. Sources: see DATA.md.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
plate |
string |
Registration number as written on the plate |
Returns
Section titled “Returns”| VehiclePlate
| null
The parts, or null if it does not have the common shape
Example
Section titled “Example”parseVehiclePlate('lea 1234');// { series: 'LEA', number: '1234', year: null, formatted: 'LEA-1234' }