From 40dcc0b38ea09c98bc577670af80dcdcf624f832 Mon Sep 17 00:00:00 2001 From: Lemon73-Computing Date: Mon, 4 Mar 2024 02:01:35 +0900 Subject: [PATCH 1/4] create: solution file --- Alice-Console.sln | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Alice-Console.sln diff --git a/Alice-Console.sln b/Alice-Console.sln new file mode 100644 index 0000000..bb32f59 --- /dev/null +++ b/Alice-Console.sln @@ -0,0 +1,14 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal From 608f4b844ec74ff95c1beaf349400c0cbb79cc93 Mon Sep 17 00:00:00 2001 From: Lemon73-Computing Date: Mon, 4 Mar 2024 02:04:39 +0900 Subject: [PATCH 2/4] create: class library and add its information in the solution file --- Alice-Console.sln | 8 ++++++++ AnovReader/AnovReader.csproj | 9 +++++++++ AnovReader/Class1.cs | 6 ++++++ 3 files changed, 23 insertions(+) create mode 100644 AnovReader/AnovReader.csproj create mode 100644 AnovReader/Class1.cs diff --git a/Alice-Console.sln b/Alice-Console.sln index bb32f59..e4e7be7 100644 --- a/Alice-Console.sln +++ b/Alice-Console.sln @@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnovReader", "AnovReader\AnovReader.csproj", "{B0401C3C-0DD7-4064-9134-CBB7F68AE63F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -11,4 +13,10 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0401C3C-0DD7-4064-9134-CBB7F68AE63F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0401C3C-0DD7-4064-9134-CBB7F68AE63F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0401C3C-0DD7-4064-9134-CBB7F68AE63F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0401C3C-0DD7-4064-9134-CBB7F68AE63F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection EndGlobal diff --git a/AnovReader/AnovReader.csproj b/AnovReader/AnovReader.csproj new file mode 100644 index 0000000..bb23fb7 --- /dev/null +++ b/AnovReader/AnovReader.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/AnovReader/Class1.cs b/AnovReader/Class1.cs new file mode 100644 index 0000000..cdb259c --- /dev/null +++ b/AnovReader/Class1.cs @@ -0,0 +1,6 @@ +namespace AnovReader; + +public class Class1 +{ + +} From 125e8caa19ef6d51f73e206b7b84cc5f501407a4 Mon Sep 17 00:00:00 2001 From: Lemon73-Computing Date: Mon, 4 Mar 2024 02:06:33 +0900 Subject: [PATCH 3/4] change: file name --- AnovReader/{Class1.cs => Anov.cs} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename AnovReader/{Class1.cs => Anov.cs} (54%) diff --git a/AnovReader/Class1.cs b/AnovReader/Anov.cs similarity index 54% rename from AnovReader/Class1.cs rename to AnovReader/Anov.cs index cdb259c..46c2f80 100644 --- a/AnovReader/Class1.cs +++ b/AnovReader/Anov.cs @@ -1,6 +1,6 @@ namespace AnovReader; -public class Class1 +public class Anov { } From 6dbcab38825a1dc446c214c1fda05f7ad24dfbcb Mon Sep 17 00:00:00 2001 From: Lemon73-Computing Date: Mon, 4 Mar 2024 12:31:30 +0900 Subject: [PATCH 4/4] add: main function --- AnovReader/Anov.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/AnovReader/Anov.cs b/AnovReader/Anov.cs index 46c2f80..7e18362 100644 --- a/AnovReader/Anov.cs +++ b/AnovReader/Anov.cs @@ -1,6 +1,20 @@ -namespace AnovReader; +using System.Text.RegularExpressions; + +namespace AnovReader; public class Anov { + static void Read(string str) + { + Match match; + // "- "から始まる"人物"を読み込み + match = Regex.Match(str, @"- (.*)"); + if (match.Success) + Console.Write(match.Groups[1].Value); + // "["と"]"で囲む"会話"を読み込み + match = Regex.Match(str, @"\[(.*?)\]"); + if (match.Success) + Console.WriteLine("「" + match.Groups[1].Value + "」"); + } }