有很多人知道正则表达式 但是却不知道明确的使用方法
一般在c#中使用IsMatch函数 在JS中使用test函数
reg = /^[a-zA-Z]\w{5,17}$;
if (reg.test(str)) {
//验证通过
}
Regex re=new Regex(@"^[a-zA-Z]\w{5,17}$");
if(re.IsMatch(str))
{
//验证通过
}
有很多人知道正则表达式 但是却不知道明确的使用方法
一般在c#中使用IsMatch函数 在JS中使用test函数
reg = /^[a-zA-Z]\w{5,17}$;
if (reg.test(str)) {
//验证通过
}
Regex re=new Regex(@"^[a-zA-Z]\w{5,17}$");
if(re.IsMatch(str))
{
//验证通过
}