我需要一个验证字符串(字母,数字,空格或特殊字符)的正则表达式,但不能包含大于35个字符的单词,例如:
有效:这是一个测试字符串
无效:这是一个testtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt衣线
谢谢
答案 0 :(得分:1)
[a-zA-Z0-9~@#\^\$&\*\(\)-_\+=\[\]\{\}\|\\,\.\?\s]{,35}
您可以根据需要添加其他special characters
。