我应该使用哪个正则表达式来忽略 IDEA 中自动生成的 TODO?
在 IntelliJ 中的 TODO 列表中,我想忽略自动生成的 TODO,例如:
// TODO Auto-generated method stub
我正在尝试以下正则表达式,但没有成功:
\btodo\b^(?!Auto-generated).*
我错过了什么?
提前致谢。
In my TODO list in IntelliJ, I'd like to ignore auto-generated TODOs such as:
// TODO Auto-generated method stub
I'm trying the following regex without success:
\btodo\b^(?!Auto-generated).*
What am I missing?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
^
放置不正确。试试这个:The
^
is not placed correctly. Try this:这有用吗?
does this work?
所以基本上这个正则表达式可能永远不会匹配。你匹配一个单词然后匹配字符串的开头?怎么会发生这种事呢?另外,您忽略//,您的大写是错误的,并且您在否定前瞻中转义了括号。这似乎与您的输入不匹配...
So basically this regex will probably never match. You match a word and then you match the start of the string? How can this ever happen? Also you ignore //, your capitalization is wrong and you escape brackets inside your negative lookahead. This does not seem to match your input...
你忘了考虑空格(以及它之前的任何内容),为什么你在它周围放了 [] ?短语中没有您想要匹配的位置
you forgot to account for the space (and anything that might precede it) and why did you put [] around it? it's nowhere in the phrase that you want to match