摘要:
1.验证Email地址bool IsValidEmail(string strIn){// Return true if strIn is in valid e-mail format.return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");}2.dd-mm-yy 的日期形式代替 mm/dd/yy 的日期形式。string MDYToDMY(String input) 阅读全文
posted @ 2013-10-23 10:18
豆豆0829
阅读(459)
评论(0)
推荐(0)
摘要:
★//匹配举例 Regex.IsMatchwhile (true){ //电话号码规则:010-11111111,0531-1111111,10086,13800000000 Console.WriteLine("请输入一个电话号码:"); string phone = Console.ReadLine(); bool b = Regex.IsMatch(phone, @"^((\d{3,4}\-?\d{7,8})|(\d{5}))$"); Console.WriteLine(b);}//================================= 阅读全文
posted @ 2013-10-23 10:12
豆豆0829
阅读(333)
评论(0)
推荐(0)

浙公网安备 33010602011771号