Archived
1
0
This commit is contained in:
2025-11-15 20:25:57 +08:00
Unverified
parent 5478d0ed37
commit bb4a37acc4
99 changed files with 4315 additions and 16 deletions
+11
View File
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>_15_7</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+25
View File
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36623.8 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "15_7", "15_7.csproj", "{79C1A3AF-2C09-4966-8EC3-9156C7A58750}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{79C1A3AF-2C09-4966-8EC3-9156C7A58750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79C1A3AF-2C09-4966-8EC3-9156C7A58750}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79C1A3AF-2C09-4966-8EC3-9156C7A58750}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79C1A3AF-2C09-4966-8EC3-9156C7A58750}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {322B6BB6-0C56-4401-8745-CB8F1D6304A0}
EndGlobalSection
EndGlobal
+23
View File
@@ -0,0 +1,23 @@
using System.Text.RegularExpressions;
namespace _15_7
{
internal class Program
{
static void Main(string[] args)
{
MatchCollection mc;
string[] result = new string[20]; int[] matchposition = new int[20];
Regex r = new Regex("abc");
mc = r.Matches("123abc4abcd");
Console.WriteLine("源字符串123abc4abcd");
Console.WriteLine("匹配字符串abc");
for (int i = 0; i < mc.Count; i++)
{
result[i] = mc[i].Value;
matchposition[i] = mc[i].Index;
Console.WriteLine("索引位置{0};结果{1}", mc[i].Index, mc[i].Value);
}
}
}
}