代码改变世界

c# 正则验证

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

1.验证百分数

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