Parsing of text into a primitive value is easy enough using the various kinds of
Parse methods. However, a more complex parsing task often needs to be accomplished. In that case, the BCL’s support for regular expressions enters the picture. Because regular expressions are a language of their own, we just touch on some of the capabilities, deferring a thorough discussion to MSDN once more.
The first thing to make sure when working with regular expression facilities is to have a
using directive to import the
System.Text.RegularExpressions namespace. When this is done, you have unqualified access to the
Regex class, which is the entry point of the API. First, you create a new instance of this class, specifying the regular expression ...