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.
我正在尝试将表单属性设置为仅接受没有空格和特殊字符的文本和数字。我尝试了几个正则表达式,但它不去,请帮助。这是我的表单流属性代码
[Pattern(@"^[\w,\s-]+\.[A-Za-z]{3}$")]
我最近用
^[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df]+[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df0-9_]*$
它包括德国元音变音(äöüÄÖÜ)以及我认为的 Eszett(ß)。您可以删除所有这些 \uXXXX 字符