fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Linq;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var source = "@fish and fries and @Mary's beer are @good";
  9. var res = Regex.Matches(source, @"(?<!\S)@([a-zA-Z0-9-_]+)")
  10. .Cast<Match>()
  11. .Select(m=>m.Groups[1].Value)
  12. .ToList();
  13. Console.WriteLine(string.Join("; ", res));
  14. }
  15. }
Success #stdin #stdout 0.03s 134720KB
stdin
Standard input is empty
stdout
fish; Mary; good