代码改变世界

c# 正则验证

2018-12-06 10:50  石吴玉  阅读(202)  评论(0)    收藏  举报

1.验证百分数

bool tempBool = Regex.IsMatch(str, @"[1-9]{0,1}[0-9](\\.[0-9])?%");