Created
February 16, 2023 08:59
-
-
Save micaiah-effiong/bf4136af0b21eff64be53448c541d992 to your computer and use it in GitHub Desktop.
Regex for validating Nigerian vehicle plate number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const plateNumberRexEx = /^(KWL|ABC|BWR|RSH|JJJ|AAA|LSR|FKJ|FST|APP|AGL|EPE|LND|MUS|KRE|FNN|SGB|LES|EDE|GBN|BAT|CRC|BDW|DDM|BKR|DMS|NGW|JBY|KFY|BRE|DJA|MLF|KTN|DTS|BDJ|GBR|SEY|LUY|AME|MAP|NRK|BJE|KAM|ANA|CAL|KMM|BRA|DUK|GEP|BNS|EFE|GGJ|CKK|TGD|UDU|BKS|GWL|NSR|UGG|KMC|TRN|DTF|DAL|KER|EFY|ADK|EMR|AMK|KLE|TUN|WEN|KEK|AKR|KTP|FFN|REE|SUA|JTA|NND|ABU|AHD|KNM|ABM|NDN|BGM|BNY|DEG|NCH|MHA|KHE|KPR|SKP|BRR|RUM|RGM|GGU|KRK|BER|PBT)-\d{3}[A-Z]{2}$/gi; | |
| function validatePlateNumber(pn: string): boolean{ | |
| return plateNumberRexEx.test(pn) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment