标签:parse logs tps lin test 类型 OLE lag 自带
//URL
Console.WriteLine(Regex.IsMatch("https://www.cnblogs.com", "[a-zA-z]+://[^\\s]*"));
//邮箱
Console.WriteLine(Regex.IsMatch("nettest@163.com", "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"));
//IP
Console.WriteLine(Regex.IsMatch("10.1.2.1", "((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)"));
//手机
Console.WriteLine(Regex.IsMatch("13108451234", "^1(3[0-9]|4[5-9]|5[0-35-9]|66|7[013-8]|8[0-9]|9[89])\\d{8}$"));
//身份证
Console.WriteLine(Regex.IsMatch("430525202001020114", "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9Xx])$"));
int i;
int.TryParse("a", out i);
DateTime dateTime;
DateTime.TryParse("a", out dateTime);
decimal k;
decimal.TryParse("a", out k);
bool flag;
bool.TryParse("a", out flag);
标签:parse logs tps lin test 类型 OLE lag 自带
原文地址:https://www.cnblogs.com/SuperDust/p/13341014.html