I have written a regex for testing both Indian vehicle chassis number and engine numberes like ME4KC093A98040032,- Chassis No
JF39E70321656 -Engine No
The regex that i'm written for matching these is,
/^([A-z]{2}[A-z0-9]{5,16})$/
But this regex matching other strings like JOHNDEO, or the strings which contains underscores.
Can anyone suggest me an advanced regex pattern to over come the issues i'm facing by satisfying the below given points.
- starts with Alpha bates(At least 2)
2.Only contains Alphanumerical
3.Restriction for special characters including underscore.
4.it should contain at least 2 alphabets and numbers.
5.minimum of 7 numbers and maximum of 18 numbers.
UPDATION:
modified the regex like
/^([A-Za-z]{2}[A-z0-9]{5,16})$/
But this could only satisfy the condition 3.