Consider the following:
string keywords = "(load|save|close)";
Regex x = new Regex(@"\b"+keywords+"\b");
I get no matches. However, if I do this:
Regex x = new Regex(@"\b(load|save|close)\b");
I get matches. How come the former doesn't work, and how can I fix this? Basically, I want the keywords to be configurable so I placed them in a string.