CASCExplorer.Wildcard.WildcardToRegex C# (CSharp) 메소드

WildcardToRegex() 공개 정적인 메소드

Converts a wildcard to a regex.
public static WildcardToRegex ( string pattern, bool matchStartEnd ) : string
pattern string The wildcard pattern to convert.
matchStartEnd bool
리턴 string
        public static string WildcardToRegex(string pattern, bool matchStartEnd)
        {
            if (matchStartEnd)
                return "^" + Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".") + "$";
            return Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".");
        }