1using System;
2using System.Text.RegularExpressions;
3
4public static string[] Tokenize(string equation)
5{
6 Regex RE = new Regex(@"([\+\-\*\(\)\^\\])");
7 return (RE.Split(equation));
8}
9
10public void TestTokenize( )
11{
12 foreach(string token in Tokenize("(y - 3)(3111*x^21 + x + 320)"))
13 Console.WriteLine("String token = " + token.Trim( ));
14}