# parseVehiclePlate

Source: https://pakdatakit.dev/api/typescript/vehicle/functions/parsevehicleplate/

```ts
function parseVehiclePlate(plate): 
  | VehiclePlate
  | null;
```

Defined in: [vehicle.ts:37](https://github.com/chmuzamil/pakdatakit/blob/a6eeaa47381308c4e4fcda45b29642fe4fbfb1fc/src/vehicle.ts#L37)

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

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `plate` | `string` | Registration number as written on the plate |

## Returns

  \| [`VehiclePlate`](https://pakdatakit.dev/api/typescript/vehicle/interfaces/vehicleplate/)
  \| `null`

The parts, or `null` if it does not have the common shape

## Example

```ts
parseVehiclePlate('lea 1234');
// { series: 'LEA', number: '1234', year: null, formatted: 'LEA-1234' }
```
