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.
我想用正则表达式控制我的字符串,它应该在 a 和 z 之间有字符(可以是大写)和“;” 字符。(只有 az 和 ";" 带有空格)。我的正则表达式应该是什么?
取决于 RE 引擎,但你会寻找类似的东西:
^[a-zA-Z;\s]*$
如果您需要至少一个字符,或者使用+而不是。*
+
*
您可以使用此正则表达式: [a-zA-Z;\s]*
这个正则表达式应该这样做 /[a-zA-Z;\s]*/