fork(2) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string linha = "'Oi 1' 'tchau 2' 'hello 3' 'good bye 4'";
  9. string regex = @"'([^']+)'";
  10. MatchCollection match = Regex.Matches(linha, @regex);
  11.  
  12. string[] dados = new string[match.Count];
  13.  
  14. for (int i = 0; i < dados.Length; i++)
  15. {
  16. dados[i] = match[i].Groups[1].Value;
  17. Console.WriteLine(dados[i]);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.03s 30112KB
stdin
Standard input is empty
stdout
Oi 1
tchau 2
hello 3
good bye 4