Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Regular Expressions

Unless you have previously used regular expressions, the term may be unfamiliar to you. However, you have undoubtedly used some regular expression concepts outside the area of scripting.

For example, you most likely use the ? and * wildcard characters to find files on your hard disk. The ? wildcard character matches a single character in a file name, while the * wildcard character matches zero or more characters. A pattern such as data?.dat would find the following files:

data1.dat

data2.dat

datax.dat

dataN.dat

Using the * character instead of the ? character expands the number of found files. data*.dat matches all of the following:

data.dat

data1.dat

data2.dat

data12.dat

datax.dat

dataXYZ.dat

While this method of searching is useful, it is also limited. The ability of the ? and * wildcard characters introduces the concept behind regular expressions, but regular expressions are more powerful and flexible.

Community Additions

ADD
Show:
© 2015 Microsoft