摘要: 1.首先引入命名空间using System.Text.RegularExpressions;2.定义正则验证方法 //str是要被验证的字符串,regexStr为正则表达式 public static bool GetRegexInput(string str, string regexStr) { Regex rStr = new Regex(regexStr); bool bResult = false; if (rStr.IsMatch(str)) { bResult = true; } return bResult; } 3.测试注册密码格式(至少为6位,由非纯数字或字母组成) // 阅读全文
posted @ 2013-02-19 11:30 _YMW 阅读(830) 评论(0) 推荐(0) 编辑