isAlphaNum() public static method

public static isAlphaNum ( long self ) : bool
self long
return bool
Example #1
0
        public static Regex glob(string pattern)
        {
            StringBuilder s = new StringBuilder();

            for (int i = 0; i < pattern.Length; ++i)
            {
                int c = pattern[i];
                if (FanInt.isAlphaNum(c))
                {
                    s.Append((char)c);
                }
                else if (c == '?')
                {
                    s.Append('.');
                }
                else if (c == '*')
                {
                    s.Append('.').Append('*');
                }
                else
                {
                    s.Append('\\').Append((char)c);
                }
            }
            return(new Regex(s.ToString()));
        }
Example #2
0
        public static Regex quote(string str)
        {
            StringBuilder s = new StringBuilder();

            for (int i = 0; i < str.Length; ++i)
            {
                int c = str[i];
                if (FanInt.isAlphaNum(c))
                {
                    s.Append((char)c);
                }
                else
                {
                    s.Append('\\').Append((char)c);
                }
            }
            return(new Regex(s.ToString()));
        }