How to write regex to match only one digit at end of pattern? -
my field supposed in format of a111-1a1, regex allows last number more 1 digit (eg. a111-1a1212341). how fix this?
below regex using.
var validchar = /^[a-z](([0-9]{3})+\-)[0-9][a-z][0-9]+$/;
remove + @ end of pattern. allows more 1 numeric @ end.
var validchar = /^a-z[0-9][a-z][0-9]$/; however, pattern otherwise doesn't right want. exact pattern using?
Comments
Post a Comment