Hi, @Karthikeyan
I speculate that the & gt symbol in the problem is a web page parsing error, it should be >
using System;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
string input = "Created by @< MyName >; for the #ID-876 and reviewed by @< HisName >;";
string pattern = @"@<([^>]*)>";
MatchCollection matches = Regex.Matches(input, pattern);
if (matches.Count > 0)
{
foreach (Match match in matches)
{
string extractedText = match.Groups[1].Value;
Console.WriteLine("text: " + extractedText);
}
}
else
{
Console.WriteLine("not found");
}
}
}
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.