fork(1) 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 inputList = new List<string>() { "bbb aaa.a1 bbb", "ccc aaa.a2 ccc" };
  12. var result = inputList
  13. .Select(i => Regex.Match(i, @"\baaa\.\S+")?.Value)
  14. .Where(x => !string.IsNullOrEmpty(x))
  15. .ToList();
  16. foreach (var s in result)
  17. Console.WriteLine(s);
  18. }
  19. }
Success #stdin #stdout 0.03s 134592KB
stdin
Standard input is empty
stdout
aaa.a1
aaa.a2