Skip to content

Commit 3d61319

Browse files
author
283591387@qq.com
committed
增加扩展方法手机号验证支持199开头
1 parent 49b53fc commit 3d61319

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.Net6版本/VOL.Core/Extensions/ObjectExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ public static string ToUnixTimeStamp(this DateTime date)
11711171
return timeStamp.Substring(0, timeStamp.Length - 7);
11721172
}
11731173

1174-
private static readonly Regex MobileRegex = new Regex("^1[3|4|5|7|8][0-9]\\d{4,8}$");
1174+
private static readonly Regex MobileRegex = new Regex("^1[3-9][0-9]\\d{4,8}$");
11751175
private static readonly Regex EmailRegex = new Regex("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,3}){1,2})$");
11761176

11771177
/// <summary>
@@ -1183,7 +1183,7 @@ public static bool IsMobile(this string mobile)
11831183
{
11841184
return MobileRegex.IsMatch(mobile);
11851185
}
1186-
1186+
11871187
/// <summary>
11881188
/// 判断当前字符串是否为邮箱
11891189
/// </summary>

Vue.Net/VOL.Core/Extensions/ObjectExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ public static string ToUnixTimeStamp(this DateTime date)
11711171
return timeStamp.Substring(0, timeStamp.Length - 7);
11721172
}
11731173

1174-
private static readonly Regex MobileRegex = new Regex("^1[3|4|5|7|8][0-9]\\d{4,8}$");
1174+
private static readonly Regex MobileRegex = new Regex("^1[3-9][0-9]\\d{4,8}$");
11751175
private static readonly Regex EmailRegex = new Regex("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,3}){1,2})$");
11761176

11771177
/// <summary>

开发版dev/Vue.NetCore/Vue.Net/VOL.Core/Extensions/AutofacManager/AutofacContainerModuleExtension.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public static IServiceCollection AddModule(this IServiceCollection services, Con
9191
{
9292
builder.RegisterType<MemoryCacheService>().As<ICacheService>().SingleInstance();
9393
}
94+
9495
return services;
9596
}
9697

开发版dev/Vue.NetCore/Vue.Net/VOL.Core/Extensions/ObjectExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ public static string ToUnixTimeStamp(this DateTime date)
11711171
return timeStamp.Substring(0, timeStamp.Length - 7);
11721172
}
11731173

1174-
private static readonly Regex MobileRegex = new Regex("^1[3|4|5|7|8][0-9]\\d{4,8}$");
1174+
private static readonly Regex MobileRegex = new Regex("^1[3-9][0-9]\\d{4,8}$");
11751175
private static readonly Regex EmailRegex = new Regex("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,3}){1,2})$");
11761176

11771177
/// <summary>

0 commit comments

Comments
 (0)