fork(1) 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 pattern = @"(\s+[~-]\s+)";
  12. var text = "{ Items.Test1 } ~ { Items.test2 } - { Items.Test3 }";
  13. var result = Regex.Split(text, pattern);
  14. //var result = Regex.Split(text, pattern).Where(x => !String.IsNullOrWhiteSpace(x)).ToList();
  15. foreach (var s in result)
  16. Console.WriteLine(s);
  17. }
  18. }
Success #stdin #stdout 0.07s 29244KB
stdin
Standard input is empty
stdout
{ Items.Test1 }
 ~ 
{ Items.test2 }
 - 
{ Items.Test3 }