greece-vehicle-plate
v1.0.0
Published
Check that a vehicle registration plate number used in Greece is valid
Downloads
13
Maintainers
Readme
greece-vehicle-plate
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