Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hashaaan/ca37a3cdb57b9ec8ea58df742903acc6 to your computer and use it in GitHub Desktop.
Save hashaaan/ca37a3cdb57b9ec8ea58df742903acc6 to your computer and use it in GitHub Desktop.
// Sri Lankan Modern Licence Number Plate Regex //
FORMAT : PP LLL DDDD
PP - Province (SP, NW, WP, UP, CP, NC, SG, EP, NP)
LLL - 3 Letter
DDDD - 4 Digits
Regex : ^(SP|NW|WP|UP|CP|NC|SG|EP|NP{1,2})\s([A-Z]{1,3})\s([0-9]{4}(?<!0{4}))$
MATCHING SAMPLES:
* SP ABC 3429
* NW AWD 3421
https://regex101.com/r/MgQejy/2
# By Hashan Shalitha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment