fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Demo {
  5. public static void Main()
  6. {
  7. string str = "user1;user2;user3;user4";
  8. Regex re = new Regex(@"\w+;?");
  9. foreach (var match in re.Matches(str)) {
  10. Console.WriteLine(match);
  11. }
  12. }
  13. }
Success #stdin #stdout 0.06s 34064KB
stdin
Standard input is empty
stdout
user1;
user2;
user3;
user4