I want to write a regular expression in C# so that the user can input a word he is looking for. For example: User writes in to a textBox in WPF the name of a movie. In C# I store that text input into a string variable.
How can I add that variable to a regular expression?
string nameOfMovie = textBox.Text;
string reg = @".*(nameOfMovie).*";
In the end I want to see all the movies in a List for example that contain the entered word.
P.s. I know it can be done a lot quicker with c# built in string functions but I want to use regular expressions.