初始化提交
This commit is contained in:
35
电子展板/Utility/Core/RegexHelper.cs
Normal file
35
电子展板/Utility/Core/RegexHelper.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace 电子展板.Utility.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作正则表达式的公共类
|
||||
/// </summary>
|
||||
public class RegexHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 验证输入字符串是否与模式字符串匹配,匹配返回true
|
||||
/// </summary>
|
||||
/// <param name="input">输入字符串</param>
|
||||
/// <param name="pattern">模式字符串</param>
|
||||
public static bool IsMatch(string input, string pattern)
|
||||
{
|
||||
return IsMatch(input, pattern, RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证输入字符串是否与模式字符串匹配,匹配返回true
|
||||
/// </summary>
|
||||
/// <param name="input">输入的字符串</param>
|
||||
/// <param name="pattern">模式字符串</param>
|
||||
/// <param name="options">筛选条件</param>
|
||||
public static bool IsMatch(string input, string pattern, RegexOptions options)
|
||||
{
|
||||
return Regex.IsMatch(input, pattern, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user