feat: 车牌号校验

This commit is contained in:
lyx 2024-03-19 15:08:18 +08:00
parent 200a58f370
commit cd69f62768

View File

@ -8,7 +8,7 @@ const validateLicensePlate = (plateNumber: string): boolean => {
if (!plateNumber) { if (!plateNumber) {
return false; return false;
} }
const regularExpression = /^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{5}(\u6302)?$/; const regularExpression = /^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
return regularExpression.test(plateNumber); return regularExpression.test(plateNumber);
}; };