Regular expressions
Another form of pattern matching is represented by regular expressions. A regular expression is a pattern that can be matched against a text. Although not supported directly at the language level, regular expressions are made available to .NET developers through the Regex class from the System.Text.RegularExpressions
namespace. In the following pages, we will look at how you can use this class to match an input text, find parts of it, or replace portions of the text.
Regular expressions are composed of constants (that represent sets of strings) and operator symbols (that represent operations on these sets). The actual language for building regular expressions is more complex than what can be described in the scope of this chapter. If you are not familiar with regular expressions, we recommend using additional resources for learning them. You can also build and test your regular expressions using online tools such as https://regex101.com/ or https://regexr.com...