⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regexfac.cs

📁 学习正则表达式的编写
💻 CS
字号:
using System;
using System.Text;
using System.Text.RegularExpressions;

namespace RegexTool
{
	/// <summary>
	/// RegexFac 的摘要说明。
	/// </summary>
	public class RegexFac
	{
		private bool IsUL;
		private bool IsComment;
		private string regex;
		public RegexFac(string regex, bool UL, bool Comment)
		{
			this.regex = regex;
			this.IsUL = UL;
			this.IsComment = Comment;
		}

		public Regex GetRegex()
		{
			if ( IsUL==false && IsComment==false )
			{
				return ( new Regex(regex) );
			}
			if ( IsUL==true && IsComment==false )
			{
				return ( new Regex(regex, RegexOptions.IgnoreCase) );
			}
			if ( IsUL==false && IsComment==true )
			{
				return ( new Regex(regex, RegexOptions.IgnorePatternWhitespace) );
			}

			return ( new Regex(regex, RegexOptions.IgnorePatternWhitespace|RegexOptions.IgnoreCase) );

		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -