Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用实时验证脚本
http://livevalidation.com
我需要检查文本是否包含除 _ (下划线) - (hyphen) 之外的特殊字符。(点)和空格 除了那些字符之外的特殊字符的存在将不会被验证 该隐为此做什么?
我认为你被正则表达式困住了。
正则表达式是您的要求是/^[a-z0-9_ .-]*$/i
/^[a-z0-9_ .-]*$/i
var myField = new LiveValidation('myField', { validMessage: "I am valid!" }); myField.add(Validate.Format, { pattern: /^[a-z0-9_ .-]*$/i });