try below code
public static class WildcardMatch
{
#region Public Methods
public static bool IsLike(string pattern, string text, bool caseSensitive=false)
{
pattern = pattern.Replace(".", @"\.");
pattern = pattern.Replace("?", ".");
pattern = pattern.Replace("*", ".*?");
pattern = pattern.Replace(@"\", @"\\");
pattern = pattern.Replace(" ", @"\s");
return new Regex(pattern, caseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase).IsMatch(text);
}
#endregion
}