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.
我正在使用 Sublime Text,我想.btn在 CSS 样式表中进行搜索,但我也得到了意想不到的结果.btn-sm。我已经打开了整个单词,但它似乎无法正常工作......
.btn
.btn-sm
我怎样才能做到这一点?
正则表达式搜索可以解决问题:
\.btn(?![-|\w])
它搜索.btn带有负前瞻的文字序列,以确保下一个字符既不是-符号也不是单词字符。这样搜索将不匹配.btnfoo,例如(下面的第 6 行)。
-
.btnfoo