Skip to content

Commit

Permalink
wip: 手机号判断支持19x
Browse files Browse the repository at this point in the history
  • Loading branch information
gmf520 committed Sep 6, 2024
1 parent c8df3fa commit d31bd5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OSharp.Utils/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// <copyright file="StringExtensions.cs" company="OSharp开源团队">
// Copyright (c) 2014 OSharp. All rights reserved.
// </copyright>
Expand Down Expand Up @@ -327,7 +327,7 @@ public static bool IsIdentityCardId(this string value)
/// <param name="isRestrict">是否按严格格式验证</param>
public static bool IsMobileNumber(this string value, bool isRestrict = false)
{
string pattern = isRestrict ? @"^[1][3-8]\d{9}$" : @"^[1]\d{10}$";
string pattern = isRestrict ? @"^1[3-9]\d{9}$" : @"^1\d{10}$";
return value.IsMatch(pattern);
}

Expand Down Expand Up @@ -956,4 +956,4 @@ public static double GetSimilarityWith(this string source, string target, bool i

#endregion
}
}
}

0 comments on commit d31bd5a

Please sign in to comment.