我需要regex来搜索alphanumeric, (, ), -, ., / and ampersand(&).字符串
现在,我正在客户端验证中使用这个regex。
[^A-Za-z0-9.)(/-\&]编辑:
我想在字符串中搜索特殊字符VAL.search(/[^A-Za-z0-9.)(/-\&]+/g)==-1
发布于 2011-06-07 08:59:21
转义反斜杠,将破折号放在字符类的末尾。
[^A-Za-z0-9.)(/\\&-]不知道为什么会包含^,因为这会否定字符类。
发布于 2011-06-07 09:00:38
试试这个:
VAL.search(/[^a-zA-Z0-9.()/&-]/g) == -1https://stackoverflow.com/questions/6262867
复制相似问题