public static string MakeRegexSafe(object value) { string text = (value ?? string.Empty).ToString(); return Regex.Escape(text); }