Ejemplo n.º 1
0
        public static bool IsVariant(string s)
        {
            // variant       = 5*8alphanum         ; registered variants
            //               / (DIGIT 3alphanum)
            int len = s.Length;

            if (len >= 5 && len <= 8)
            {
                return(AsciiUtil.IsAlphaNumericString(s));
            }
            if (len == 4)
            {
                return(AsciiUtil.IsNumeric(s[0]) &&
                       AsciiUtil.IsAlphaNumeric(s[1]) &&
                       AsciiUtil.IsAlphaNumeric(s[2]) &&
                       AsciiUtil.IsAlphaNumeric(s[3]));
            }
            return(false);
        }
Ejemplo n.º 2
0
 public static bool IsTypeSubtag(string s)
 {
     // 3*8alphanum
     return((s.Length >= 3) && (s.Length <= 8) && AsciiUtil.IsAlphaNumeric(s));
 }
Ejemplo n.º 3
0
 public static bool IsKey(string s)
 {
     // 2alphanum
     return((s.Length == 2) && AsciiUtil.IsAlphaNumeric(s));
 }
Ejemplo n.º 4
0
 public static bool IsPrivateuseSubtag(string s)
 {
     // privateuse    = "x" 1*("-" (1*8alphanum))
     return((s.Length >= 1) && (s.Length <= 8) && AsciiUtil.IsAlphaNumeric(s));
 }
Ejemplo n.º 5
0
 public static bool IsExtensionSubtag(string s)
 {
     // extension     = singleton 1*("-" (2*8alphanum))
     return((s.Length >= 2) && (s.Length <= 8) && AsciiUtil.IsAlphaNumeric(s));
 }