using System.Text.RegularExpressions;
public static void Main()
var regex = new Regex(@"(?<mode>[A-Z]+)([ \-:]+(?<responses>[A-Z; ]+\b))?");
"<!-- MOCK:SENT;FAIL -->",
"<!--MOCK:SENT;SUCCESS-->",
"<!--MOCK:SENT; SUCCESS-->",
"<!--MOCK:SENT ; SUCCESS-->",
foreach (var value in values)
var match = regex.Match(value);
Console.WriteLine($"Mode: [{match.Groups["mode"].Value}], Responses: [{match.Groups["responses"].Value}]");