我使用了这个正则表达式 ^(?=. [a-zA-Z]. )[a-zA-Z0-9 ?.! @#'\s]{2,200}$。它应该包含特殊的 (! @#) 字母数字字符,并且最多允许 200 个字符。但是在这里我得到了像未终止的字符串常量这样的错误..在谷歌我试过......它是说我们需要用 \ 替换像 $,* 这样的元字符我做不到..任何人都可以帮助我
我的代码是这样的
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
"alertText": "This field is required",
"alertTextCheckboxMultiple": "* Please select an option",
"alertTextCheckboxe": "* This checkbox is required",
"alertTextDateRange": "* Both date range fields are required"
},
---
----
"passwordval": {
"regex":^(?=.*[a-zA-Z].*)[a-zA-Z0-9 ?.!*@#'\s]{2,200}$,
"alertText": "* Not a valid password"
},
};
}
};
$.validationEngineLanguage.newLang();
我在“passwordval”中遇到问题: