VSProject_Clear/TouTouRegex.cs

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TouTouRegex.cs" owner="TouTou">
//   Copyright (c) TouTou Owner. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace TouTou.RegexTool
{
    using System.Collections.Generic;
    using System.Text.RegularExpressions;

    /// <summary>
    /// 正则表达式工具,满足各种需要使用正则的需求
    /// </summary>
    public class TouTouRegex
    {
        /// <summary>
        /// 检测字符串中是否包含符合正则的子集
        /// </summary>
        /// <param name="source">源字符串</param>
        /// <param name="reg">正则, e.g. \d+</param>
        /// <returns>true:包含,反之不包含</returns>
        public bool CheckContainsByReg(string source, string reg)
        {
            return Regex.Match(source, reg).Success;
        }
        /// <summary>
        /// 检测字符串中是否包含符合正则的子集
        /// </summary>
        /// <param name="source">源字符串</param>
        /// <param name="reg">正则, e.g. \d+</param>
        /// <returns>true:包含,反之不包含</returns>
        public bool CheckContainsByReg(string source, List<string> list)
        {
            bool Success = false;
            foreach (string item in list)
            {
                if (Regex.Match(source, item).Success)
                {
                    Success = Regex.Match(source, item).Success;
                }
            }
            return Success;
        }
        /// <summary>
        /// 检测字符串中是否包含符合正则的子集
        /// </summary>
        /// <param name="source">源字符串</param>
        /// <param name="reg">正则, e.g. \d+</param>
        /// <returns>true:包含,反之不包含</returns>
        public bool CheckContainsByReg(string source,string[] list)
        {
            bool Success = false;
            foreach (string item in list)
            {
                if (Regex.Match(source, item).Success)
                {
                    Success = Regex.Match(source, item).Success;
                }
            }
后面还有 262 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。