fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"(?:To:\s+|\G(?!^))(?:,\s*)?([^\s@,]+@[^\s@,]+)";
  9. string input = @"To: sandy.lewis@test.com,alewis@testpage.com, drtmirk@test.org.au ,";
  10. RegexOptions options = RegexOptions.Multiline;
  11.  
  12. foreach (Match m in Regex.Matches(input, pattern, options))
  13. {
  14. Console.WriteLine(m.Groups[1].Value);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.06s 29584KB
stdin
Standard input is empty
stdout
sandy.lewis@test.com
alewis@testpage.com
drtmirk@test.org.au