Check that a vehicle registration plate number used in Greece is valid.
$ npm install greece-vehicle-plate
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