10 个解决方案
#1
对了,大写字母也可以.
#2
string[] slist = {
"abcd",
"123434",
"abbd123",
"12aA_",
"abd1234567890defa",
};
Regex re = new Regex(@"^(?!\d+$)[_a-zA-Z0-9]{4,16}$");
foreach (string s in slist)
{
Console.WriteLine("{0} matches?\t{1}", s, re.IsMatch(s));
}
"abcd",
"123434",
"abbd123",
"12aA_",
"abd1234567890defa",
};
Regex re = new Regex(@"^(?!\d+$)[_a-zA-Z0-9]{4,16}$");
foreach (string s in slist)
{
Console.WriteLine("{0} matches?\t{1}", s, re.IsMatch(s));
}
#3
试没试楼上的对吗??
#4
^(?!\d+$)[_a-zA-Z0-9]{4,16}$
#5
#6
guishuanglin (小桂子),看看正确答案吧
(?!^[0-9]*$)^([a-z0-9_]{4,16}$)
(?!^[0-9]*$)^([a-z0-9_]{4,16}$)
#7
我试试。
#8
结果正确,给分
#9
saucer(思归)正解
#10
经过
#1
对了,大写字母也可以.
#2
string[] slist = {
"abcd",
"123434",
"abbd123",
"12aA_",
"abd1234567890defa",
};
Regex re = new Regex(@"^(?!\d+$)[_a-zA-Z0-9]{4,16}$");
foreach (string s in slist)
{
Console.WriteLine("{0} matches?\t{1}", s, re.IsMatch(s));
}
"abcd",
"123434",
"abbd123",
"12aA_",
"abd1234567890defa",
};
Regex re = new Regex(@"^(?!\d+$)[_a-zA-Z0-9]{4,16}$");
foreach (string s in slist)
{
Console.WriteLine("{0} matches?\t{1}", s, re.IsMatch(s));
}
#3
试没试楼上的对吗??
#4
^(?!\d+$)[_a-zA-Z0-9]{4,16}$
#5
#6
guishuanglin (小桂子),看看正确答案吧
(?!^[0-9]*$)^([a-z0-9_]{4,16}$)
(?!^[0-9]*$)^([a-z0-9_]{4,16}$)
#7
我试试。
#8
结果正确,给分
#9
saucer(思归)正解
#10
经过