We will be create a new class in C# called Chapter9
. Here, we will create various methods to illustrate the use of regex.
For the purpose of this book, we will create a simple console application to illustrate the use of regex. In reality, you would probably not have this logic mixed in with your production code, because this would result in code being rewritten. The best place to add something like regex is in a helper class within an extension method.
Chapter9
:Class1.cs
file and select Rename from the context menu:Class1.cs
file to Recipes.cs
and select Yes from the confirmation dialog:Chapter9
and click on OK to add it as a reference to the console application:Recipes
class, add the following using
statement so that we can use the regex assembly in .NET:using System.Text.RegularExpressions;
Chapter9
class should look like this:using System.Text.RegularExpressions; namespace Chapter9 { public class Recipes { } }
18.226.104.27