I am trying for a regular expression for below requirement.
- Total string length must be 3 or 4.
- First two characters must be from a-z or A-Z
- Last two characters must be from 0-9
I have tried the below, but I know this is not the good way
var str = /^[a-zA-Z]{1,2} + [0-9]{2} + $/,
Please help me on this.
Then you test it as:
Not sure what you really mean by
First two characters must be from a-z or A-Z, if you want those characters to be the same cases, use the regex above, otherwise