I was trying to find all usages of a variable in a SQL script today, however the script contained many similarly named variables. Simply searching for @Foo would also find @FooBar and @FooCat which was cluttering up the search results. To get around this I used the regex search feature in Visual Studio. In the find usages window, check the “Use Regular Expressions” checkbox and then include the word boundary escape code (\b) in your search. I searched for @Foo\b which will only return @Foo and even find it in cases like @Foo<space>, @Foo) and @Foo=.