fork 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 s = "local lvlr,lvll = Audiosource:GetLevel()";
  12. var pattern = @"\blocal\s+(?:(?<vars>\w+),?\s*)+=";
  13. var result = Regex.Matches(s, pattern)
  14. .Cast<Match>().Select(p => p.Groups["vars"].Captures)
  15. .ToList();
  16. foreach (var coll in result)
  17. foreach (var v in coll)
  18. Console.WriteLine(v);
  19. }
  20. }
Success #stdin #stdout 0.04s 134592KB
stdin
Standard input is empty
stdout
lvlr
lvll