Common/RegularMatch.cs
(开头部分) 28KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**//// <summary>
/// RegularMatch 的摘要说明。
/// </summary>
using System;
using System.Collections;
using System.Text.RegularExpressions;
public class RegularMatch
{
private string _String;
private bool _IsEntirety;
/// <summary>
/// 验证double类型2位小数
/// </summary>
/// <param name="itemValue"></param>
/// <returns></returns>
public static bool IsNumeric(string itemValue)
{
return (IsRegEx("^([0-9]*[.]*[0-9]{0,2})$", itemValue));
}
/// <summary>
/// 验证double类型2位小数
/// </summary>
/// <param name="itemValue"></param>
/// <returns></returns>
private static bool IsRegEx(string regExValue, string itemValue)
{
try
{
Regex regex = new System.Text.RegularExpressions.Regex(regExValue);
if (regex.IsMatch(itemValue)) return true;
else return false;
}
catch (Exception)
{
return false;
}
}
/**//// <summary>
/// 可以进行判断的类型
/// </summary>
public enum Operation
{
Byte, SByte, Int16, Int32, Int64, Single, Double, Boolean, Char, Decimal, DateTime, Date, Time,
EMail, URL, ChinaPhone, ChineseWord, ChinesePostalCode, Number, StringModel_01, StringModel_02, WideWord, NarrowWord, IPAddress,
ChineseMobile, ChineseID
};
public RegularMatch() { }
#region 用于判断字符串是否是对应类型(默认为包含匹配)#region 用于判断字符串是否是对应类型(默认为包含匹配)
public bool IsAccordType(string strVerifyString, Operation op)
{
return IsAccordType(strVerifyString, op, false);
}
#endregion
#region 用于判断字符串是否是对应类型(或是否包含对应类型的字符)#region 用于判断字符串是否是对应类型(或是否包含对应类型的字符)
/**//// <summary>
后面还有 700 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。