var validate = /^[a-zA-Z0-9]{4}$/;
我正在使用此验证输入数字或字母数字我正在检查
Indexof("@") == 0 or # ,%,&
索引也是。
但现在我需要检查
var isAccumMatch = (AccumulationString.indexOf("@") == 0 || AccumulationString.indexOf("#") == 0 || AccumulationString.indexOf("%") == 0 || AccumulationString.indexOf("&") == 0);
if(isAccumMatch)
{
var isAMatch = AccumulationString.length == 5 && validateACMSTR.test(AccumulationString);
if(!isAMatch)
{
alert("Value should be numeric or alpha numeric followed by @,#,&,%");
return false;
}
}
任何人都可以帮助我如何验证第一个字符@,#,%,&
后跟数字或字母数字。
User Input : @A234, &5674, %ABC1, #123A