I like to search for a words containing string age
in Visual Studio Find, I like to find age
in CCAge
or in any other string (like sage
, mage
, abcAGExyz
) but not in message
.
How can I achieve this?
To match any character except a list of excluded characters, put the excluded charaters between [^ and ] . The caret ^ must immediately follow the [ or else it stands for just itself.
The \b metacharacter matches at the beginning or end of a word.
To run a “whole words only” search using a regular expression, simply place the word between two word boundaries, as we did with ‹ \bcat\b ›. The first ‹ \b › requires the ‹ c › to occur at the very start of the string, or after a nonword character.
Typing a caret after the opening square bracket negates the character class. The result is that the character class matches any character that is not in the character class.
This search regex should do the trick: ~(mess)age
~(X)
is a Prevent match on X
.
To ignore Tabpages
as well, you can use ~(mess|tabp)age
. Basically |
is used as OR, like prevent match on mess
OR tabp
, you can add additional words via |
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With