This article is an (adapted) excerpt from the book C# 11 and .NET 7 – Modern Cross-Platform Development Fundamentals, and takes you step-by-step through creating a console app to explore regular expressions via some cool new .NET 7 features: the [StringSyntax] attribute and source-generated regular expressions. Pattern Matching With Regular Expressions Regular expressions are useful for validating input from the user. They are very powerful and can get very complicated.