📄 class1.cs
字号:
using System;
using System.Text.RegularExpressions;
using System.Reflection;
namespace RXassembly
{
class RXassemblyApp
{
[STAThread]
static void Main(string[] args)
{
string s = "123.45.67.89";
string e =
@"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
@"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
@"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
@"([01]?\d\d?|2[0-4]\d|25[0-5])";
Match m = Regex.Match(s, e);
Console.WriteLine("IP Address: {0}", m);
for (int i = 1; i < m.Groups.Count; i++)
Console.WriteLine(
"\tGroup{0}={1}", i, m.Groups[i]);
RegexCompilationInfo [] rci =
new RegexCompilationInfo[1];
rci[0] = new RegexCompilationInfo(
e, RegexOptions.Compiled,
"MyRegexAssembly", "MyNamespace", true);
AssemblyName an = new AssemblyName();
an.Name = "MyAss";
Regex.CompileToAssembly(rci, an);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -