正则表达式翻译
我需要将其翻译为正则表达式: 我需要找到大写单词,单词后面有空格,空格后面有一个“-”。谁能帮我翻译一下这个
i need to translate this in regex:
I need to find uppercase word,space after the word and a "-" after the white space. Can anybody help me with this translation
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然不确定翻译是什么意思,但这可能就是您想要的:
/\b[AZ]+\b -/
取决于您对单词的定义。
或者,如果大写表示第一个字母大写,请使用
/\b[AZ][az]+\b -/
。Though not sure what you mean by translate, this might be what you seek:
/\b[A-Z]+\b -/
Depends on your definition of word.
Or if uppercase means the first letter capitalized, use
/\b[A-Z][a-z]+\b -/
.[AZ]+\s-
将符合我认为您需要的内容。 1 个或多个大写字母,后跟一个空格,后跟一个减号。取决于你对大写单词的意思,我假设它都是大写字母。[A-Z]+\s-
will match what I think you need. 1 or more uppercase letters, followed by a space followed by a minus sign. Depends on what you mean about uppercase word, I assume it's all uppercase letters.