fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var p = @"""([^""]*)""\s*<([^<>]*)>";
  12. var str = "\"Some name>,\" <example@email.com>, \"<display,> >\" <display_a@email.com>'";
  13. var matches = Regex.Matches(str, p).Cast<Match>().Select(x => new[] { x.Groups[1].Value, x.Groups[2].Value }).ToArray();
  14. foreach (var pair in matches)
  15. Console.WriteLine("{0} : {1}", pair[0],pair[1]);
  16. }
  17. }
Success #stdin #stdout 0.08s 28680KB
stdin
Standard input is empty
stdout
Some name>, : example@email.com
<display,> > : display_a@email.com