15
1
using System;
2
using System.Text.RegularExpressions;
3
4
string input = "Hello, World!";
5
Regex regex = new Regex("Hello");
6
Match match = regex.Match(input);
7
8
if (match.Success)
9
{
10
Console.WriteLine($"Pattern found: {match.Value}");
11
}
12
else
13
{
14
Console.WriteLine("Pattern not found.");
15
}
Cached Result
Environment version: .NET 9.0.0 (9.0.0, Unix 6.8.0.1014)
<someOuterElementNotShown>
<title>Discourse interaction between <italic>The New York Times</italic> and <italic>China Daily</italic></title>
<subtitle>The case of Google's departure</subtitle>
</someOuterElementNotShown>
Discourse interaction between The New York Times and China Daily: The case of Google's departure
<someOuterElementNotShown>
<title>Discourse interaction between <italic>The New York Times</italic> and <italic>China Daily</italic></title>
<subtitle>The case of Google's departure</subtitle>
</someOuterElementNotShown>
Discourse interaction between The New York Times and China Daily: The case of Google's departure