Regular Expressions APIs in C#

Learn string matching with a given pattern using regular expressions, and use quantifiers and boundaries to efficiently define these patterns.

Regular expressions API

The .NET framework provides a rich and comprehensive Regex class, defined within the System.Text.RegularExpressions namespace, to match patterns of text via regular expressions.

We can use the following using statement to access the regular expressions API in our program:

using System.Text.RegularExpressions;

This System.Text.RegularExpressions namespace contains the following useful classes and interfaces.

Get hands-on with 1400+ tech skills courses.