protected String StringToRegexPattern(String str)
{
// 1. Convert / to -
str = str.Replace("/", "-");
// 2. Convert $ to \$
str = str.Replace("$", @"\$");
// 3. Convert ( to \( and ) to \)
str = str.Replace(")", @"\)");
str = str.Replace("(", @"\(");
// 4. Convert . to \.
str = str.Replace(".", @"\.");
// 5. Convert + to \+
str = str.Replace("+", @"\+");
return str;
}