我正在遵循这个官方指南,了解如何在 Android Studio 中设置自定义 TODO 过滤器。
我需要对非 TODO 的重要评论进行突出显示,例如:
// important: this note is much more important than other comment lines
// !!!: this note is also much more important than other comment lines
// normal comment
使用这个正则表达式它可以工作:
\bimportant\b.*
如何用
!!!
设置滤镜?
我尝试过这些但没有成功:
\b!+\b.*
\b!!!\b.*
\b[!]+\b.*
\b[!!!]\b.*
\b\!\b.*
\b\!\!\!\b.*
\b(important|\x0021)+\b.*
谢谢
您缺少的是
!
算作符号而不是单词的一部分,因此 \b
无法看到/识别其周围的单词边界。您需要使用类似 !!!.*
的东西来捕获带有 3 ! 的线