Chapter 11. Improving Performance by Using Regular Expressions
As you are evaluating systems with the Windows Server scanning script, there may be instances where you need to find sensitive data that doesn't match specific values. Credit card numbers, social security numbers, and even tax identification numbers are great examples of data that you need to identify, but would be impossible to search for using strings alone.
Regular expressions, however, provide pattern matching to identify data that you normally wouldn't be able to find with string searching. Regular expressions are very dynamic and can be used to detect any pattern that you need in your script. In fact, regular expressions can be so granular that they can search parts of words. This means that you can find the word Password
in the MyPasswordIsString
string.
Regular expressions are also very quick. In comparison to using multiple arrays and if
statements, regular expressions often outperform other techniques by over 50%! This...