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 input = "one two three #abc four five six #xyz";
  12. string[] digits = Regex.Split(input, @"(?<=\B#\w+)\b\s*")
  13. .Where(x => !string.IsNullOrEmpty(x)).ToArray();
  14. foreach (var s in digits)
  15. Console.WriteLine(s);
  16. }
  17. }
Success #stdin #stdout 0.09s 28000KB
stdin
Standard input is empty
stdout
one two three #abc
four five six #xyz