merged pr
This commit is contained in:
1 parent
e8ecb7d6be
commit
62b1eb2473
9 files changed
+44
-40
No files matched your search
@@ -43,7 +43,7 @@ namespace HandyControl.Tools
|
||||
|
||||
internal static void DecomposeGeometryStr(string geometryStr, out double[] arr)
|
||||
{
|
||||
var collection = Regex.Matches(geometryStr, RegularPatterns.DigitsPattern);
|
||||
var collection = Regex.Matches(geometryStr, RegexPatterns.DigitsPattern);
|
||||
arr = new double[collection.Count];
|
||||
for (var i = 0; i < collection.Count; i++)
|
||||
{
|
||||
|
||||
+12
-12
@@ -7,9 +7,9 @@ namespace HandyControl.Tools
|
||||
/// <summary>
|
||||
/// 包含一些正则验证操作
|
||||
/// </summary>
|
||||
public static class RegularJudgment
|
||||
public static class RegexJudgment
|
||||
{
|
||||
private static readonly RegularPatterns RegularPatterns = new RegularPatterns();
|
||||
private static readonly RegexPatterns RegexPatterns = new RegexPatterns();
|
||||
|
||||
/// <summary>
|
||||
/// 判断字符串格式是否符合某种要求
|
||||
@@ -32,7 +32,7 @@ namespace HandyControl.Tools
|
||||
{
|
||||
if (textType == TextType.Common) return true;
|
||||
return Regex.IsMatch(text,
|
||||
RegularPatterns.GetValue(Enum.GetName(typeof(TextType), textType) + "Pattern").ToString());
|
||||
RegexPatterns.GetValue(Enum.GetName(typeof(TextType), textType) + "Pattern").ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -42,7 +42,7 @@ namespace HandyControl.Tools
|
||||
/// <returns>方法返回布尔值</returns>
|
||||
public static bool IsEmail(this string email)
|
||||
{
|
||||
return Regex.IsMatch(email, RegularPatterns.MailPattern);
|
||||
return Regex.IsMatch(email, RegexPatterns.MailPattern);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -55,11 +55,11 @@ namespace HandyControl.Tools
|
||||
{
|
||||
switch (ipType)
|
||||
{
|
||||
case IpType.A: return Regex.IsMatch(ip, RegularPatterns.IpAPattern);
|
||||
case IpType.B: return Regex.IsMatch(ip, RegularPatterns.IpBPattern);
|
||||
case IpType.C: return Regex.IsMatch(ip, RegularPatterns.IpCPattern);
|
||||
case IpType.D: return Regex.IsMatch(ip, RegularPatterns.IpDPattern);
|
||||
case IpType.E: return Regex.IsMatch(ip, RegularPatterns.IpEPattern);
|
||||
case IpType.A: return Regex.IsMatch(ip, RegexPatterns.IpAPattern);
|
||||
case IpType.B: return Regex.IsMatch(ip, RegexPatterns.IpBPattern);
|
||||
case IpType.C: return Regex.IsMatch(ip, RegexPatterns.IpCPattern);
|
||||
case IpType.D: return Regex.IsMatch(ip, RegexPatterns.IpDPattern);
|
||||
case IpType.E: return Regex.IsMatch(ip, RegexPatterns.IpEPattern);
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace HandyControl.Tools
|
||||
/// <returns>方法返回布尔值</returns>
|
||||
public static bool IsIp(this string ip)
|
||||
{
|
||||
return Regex.IsMatch(ip, RegularPatterns.IpPattern);
|
||||
return Regex.IsMatch(ip, RegexPatterns.IpPattern);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -81,7 +81,7 @@ namespace HandyControl.Tools
|
||||
/// <returns>方法返回布尔值</returns>
|
||||
public static bool IsChinese(this string str)
|
||||
{
|
||||
return Regex.IsMatch(str, RegularPatterns.ChinesePattern);
|
||||
return Regex.IsMatch(str, RegexPatterns.ChinesePattern);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,7 +91,7 @@ namespace HandyControl.Tools
|
||||
/// <returns>方法返回布尔值</returns>
|
||||
public static bool IsUrl(this string str)
|
||||
{
|
||||
return Regex.IsMatch(str, RegularPatterns.UrlPattern);
|
||||
return Regex.IsMatch(str, RegexPatterns.UrlPattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// 包含一些正则验证所需要的字符串
|
||||
/// </summary>
|
||||
public sealed class RegularPatterns
|
||||
public sealed class RegexPatterns
|
||||
{
|
||||
/// <summary>
|
||||
/// 邮件正则匹配表达式
|
||||
Reference in new issue
Block a user