我的正则表达式应该是什么?
我想用正则表达式控制我的字符串,它应该在 a 和 z 之间有字符(可以是大写)和“;”字符。 (仅 az 和“;”带有空格)。我的正则表达式应该是什么?
I want to control my string with regex which should has chars between a and z (It can be upper case ) and ";" char. (Only a-z and ";" with whitespaces). What my regex should be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
取决于 RE 引擎,但您需要寻找类似以下内容:
或者如果您需要至少一个字符,请使用
+
而不是*
。Depends on the RE engine, but you'd be looking for something like:
or use
+
instead of*
if you need at least one character.您可以使用这个正则表达式:
[a-zA-Z;\s]*
You can use this regex:
[a-zA-Z;\s]*
这个正则表达式应该做到 /[a-zA-Z;\s]*/
this regex should do it /[a-zA-Z;\s]*/