title: C# Regex pattern to match keyword
body: <p>Question about regex pattern. I have a string input that I like to match to my array of strings. Input is not constant. For example my test inputs are "test123MakeLunch23" and "testMakeLunch(1)" I have an array of string. Example "MakeLunch" should be match to my test inputs and "DeliverLunch" should be false. I'm having a hard time on getting this work.</p>
  
  <pre><code> string input = "test123MakeLunch23";
   List&lt;string&gt; lstKeywords = new List&lt;string&gt;() { "MakeLunch", "DeliverLunch"};
   foreach (var keyword in lstKeywords)
   {
     // this is not right
     string pattern = $@"^([a-zA-Z0-9{keyword}a-zA-Z0-9)$";
  
     // on MakeLunch should return true only
     bool ismatch = Regex.IsMatch(input,pattern,RegexOptions.IgnoreCase);
   }
  </code></pre>
  
  <p>And can you add some explanation to the solution. Thank you.</p>