Skip to content

Check that a vehicle registration plate number used in Greece is valid

License

Notifications You must be signed in to change notification settings

greecejs/greece-vehicle-plate

Repository files navigation

greece-vehicle-plate Build Status Coverage Status npm

Check that a vehicle registration plate number used in Greece is valid.

Installation

$ npm install greece-vehicle-plate

Usage

To validate a plate number:

const plate = require('greece-vehicle-plate');

plate.validate('ΚΥΒ-1050'); // true
plate.validate('ΑΑΑ-1'); // false

Please note that the validation is strict, for example it will not allow spaces. Use clean() to remove any whitespace from a number before validating it:

plate.validate('ΑΒΕ -1234 '); // false
const cleaned = plate.clean('ΑΒΕ -1234 '); // 'ΑΒΕ-1234'
plate.validate(cleaned); // true

License

MIT

About

Check that a vehicle registration plate number used in Greece is valid

Resources

License

Stars

Watchers

Forks

Packages

No packages published