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 s = "Request closed by Jack Arm on 08/16/2018,Assignee #1 James Arye assigned by Scotty Shep on 08/16/2018,Request submitted by Mac Weaver on 08/16/2018,Request created by Mac Weaver on 08/16/2018";
  12. var pattern = @"((?:[a-zA-Z'-]+[^a-zA-Z'-]+){0,2})assigned by((?:[^a-zA-Z'-]+[a-zA-Z'-]+){0,2})";
  13. var matches = Regex.Matches(s, pattern);
  14. foreach (Match match in matches)
  15. {
  16. Console.WriteLine(match.Groups[1].Value.Trim());
  17. Console.WriteLine(match.Groups[2].Value.Trim());
  18. }
  19. }
  20. }
Success #stdin #stdout 0.05s 134848KB
stdin
Standard input is empty
stdout
James Arye
Scotty Shep