foxer
foxer

Reputation: 901

Searching exact woed in sublime text not working

I'm using Sublime Text and I want to search .btn in a CSS stylesheet, but I get unexpected results like .btn-sm too. I have turned on whole word but it seems not working properly...

How can Ido this?

Upvotes: 0

Views: 174

Answers (1)

MattDMo
MattDMo

Reputation: 102902

A regex search will do the trick:

\.btn(?![-|\w])

It searches for the literal sequence .btn with a negative lookahead to make sure the next character is not either a - symbol or a word character. This way the search won't match .btnfoo, for example (line 6 below).

example

Upvotes: 1

Related Questions