fork(2) download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var regex = @"'[^']*'|\b([_A-Za-z]\w*)\b(?![('])";
  10. var _expression = @"12+x1+455+'ggg+4+rrr+tt'+3";
  11. var matches = Regex.Matches(_expression, regex)
  12. .Cast<Match>()
  13. .Select(m => m.Groups[1].Value)
  14. .ToList();
  15. foreach (var s in matches)
  16. Console.WriteLine(s);
  17. }
  18. }
Success #stdin #stdout 0.02s 30416KB
stdin
Standard input is empty
stdout
x1