
Search for Patterns in Your Files #19
Chapter 3, Navigating Visual Studio
|
85
HACK
Basic Expressions
Regular expressions can be very complex, but basic expressions can be easy
to master. Unlike normal searches, regular expressions designate a pattern of
characters to match instead of a constant string. For example, square brack-
ets in a regular expression define a set of characters (a character class).
When you execute the search, it will match any one character out of the set
of characters inside the brackets, so the expression
[abcd] would match a, b,
c, and d—but not z. You can also specify character ranges inside the brack-
ets, so
[a-d] is equivalent to the expression [abcd]. If you need to specify
Figure 3-12. Visual Studio .NET 2003 Find dialog with Regular Expressions enabled
Figure 3-13. Visual Studio 2005 Find and Replace dialog with Regular Expressions
enabled