My input is
This is <a> <test> mat<ch>.
Output should be
1. <a>
2. <test>
3. <ch>
I have tried this
string input1 = "This is <a> <test> mat<ch>.";
var m1 = Regex.Matches(input1, @"<(.*)>");
var list = new List<string>();
foreach (Match match in m1)
{
list.Add(match.Value);
}
This returns <a> <test> mat<ch>
as single element in list.