using System;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
string linha = "'Oi 1' 'tchau 2' 'hello 3' 'good bye 4'";
string regex = @"'([^']+)'";
MatchCollection match = Regex.Matches(linha, @regex);
string[] dados = new string[match.Count];
for (int i = 0; i < dados.Length; i++)
{
dados[i] = match[i].Groups[1].Value;
Console.WriteLine(dados[i]);
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CiAgICAgICAgc3RyaW5nIGxpbmhhID0gIidPaSAxJyAndGNoYXUgMicgJ2hlbGxvIDMnICdnb29kIGJ5ZSA0JyI7CiAgICAgICAgc3RyaW5nIHJlZ2V4ID0gQCInKFteJ10rKSciOwogICAgICAgIE1hdGNoQ29sbGVjdGlvbiBtYXRjaCA9IFJlZ2V4Lk1hdGNoZXMobGluaGEsIEByZWdleCk7CgogICAgICAgIHN0cmluZ1tdIGRhZG9zID0gbmV3IHN0cmluZ1ttYXRjaC5Db3VudF07CgogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGFkb3MuTGVuZ3RoOyBpKyspCiAgICAgICAgewogICAgICAgICAgICBkYWRvc1tpXSA9IG1hdGNoW2ldLkdyb3Vwc1sxXS5WYWx1ZTsKICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoZGFkb3NbaV0pOwogICAgICAgIH0KCX0KfQ==