fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var str = "((1+33)()(4+(3-5)))";
  9. var tok = Regex.Split(str, @"(?<=[()+*/-])|(?=[()+*/-])");
  10. for (var i = 0 ; i != tok.Length ; i++) {
  11. Console.WriteLine(tok[i]);
  12. }
  13.  
  14. }
  15. }
Success #stdin #stdout 0.13s 24344KB
stdin
Standard input is empty
stdout
(
(
1
+
33
)
(
)
(
4
+
(
3
-
5
)
)
)