Using Regular Expressions

The use of regular expressions has been typically available to Unix shell scripts and Perl programmers. Of course, pattern matching has definitely found more uses beyond shell programming. For instance, heavy-duty text parsing is greatly simplified by using pattern-matching concepts. Whereas third-party libraries and implementations have been available for providing pattern-matching capabilities to mainstream developers, regular expression class libraries have never been “out of the box.” .NET FCL changes the scenario with the inclusion of System.Text.RegularExpressions namespace. For example, Listing 4.12 shows the use of regular expressions to validate phone numbers. Regular expressions are particularly useful for ...

Get Microsoft® .NET Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.