jQuery Validate method checking for special characters

后端 未结 3 1968
悲哀的现实
悲哀的现实 2020-12-15 12:59

I am trying (and failing) to write a regular expression statement that checks for special characters such as !@#$%^&*()_+<>?\'\"{}[] in my Javascript form validation.

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 13:44

    ^[a-zA-Z0-9;,.!@#$%:{}[]?"^&*()/\']*|[^&;<>\`]*
    

    you want special charecter add here in this [] braces ^[a-zA-Z0-9;,.!@#$%:{}[]?"^&*()/\'] and you dont want then add here this part [^&;<>\]`

提交回复
热议问题