跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

RegexHelper.cs

31 行 · 780 B历史下载
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Text.RegularExpressions;
6using System.Threading.Tasks;
7
8namespace Core.Librarys
9{
10 public static class RegexHelper
11 {
12 /// <summary>
13 /// 是否正则匹配成功
14 /// </summary>
15 /// <param name="input"></param>
16 /// <param name="pattern"></param>
17 /// <returns></returns>
18 public static bool IsMatch(string input, string pattern)
19 {
20 try
21 {
22 return Regex.IsMatch(input, pattern);
23 }
24 catch (Exception ex)
25 {
26 Logger.Error("正则表达式错误。" + ex.ToString());
27 return false;
28 }
29 }
30 }
31}