c#大于等于3且小于等于99正则表达式怎么写?

2025-03-03 18:30:58
推荐回答(4个)
回答1:

要加 ^ $这两个符号 ,一个匹配开头,一个匹配结尾

回答2:

用判断多简单,为什么非要用正则表达式?

回答3:

"[3-9]|[1-9]\d"

回答4:

static void Main(string[] args)
{
string value = "3";

Regex r = new Regex(@"^([3-9]{1})|(^[1-9]\d)$");

Console.WriteLine(r.Match(value).Success);

Console.ReadKey();
}