fork(2) download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var re = @"GeForce\s+\w+-(\w+)-(\w+)";
  9. var str = "GeForce TURBO-GTX1080-8G NVIDIA\nGeForce TURBO-GTX1070-4Gi";
  10. var res = Regex.Matches(str, re)
  11. .Cast<Match>()
  12. .Select(m => m.Groups.Cast<Group>().Skip(1).Select(g => g.Value) )
  13. .ToList();
  14. foreach (var m in res)
  15. Console.WriteLine(string.Join(" : ", m));
  16.  
  17.  
  18. }
  19. }
Success #stdin #stdout 0.13s 24464KB
stdin
Standard input is empty
stdout
GTX1080 : 8G
GTX1070 : 4Gi