using System.Collections.Generic;
using CodingSeb.ExpressionEvaluator;
public static void Main()
ExpressionEvaluator evaluator = new ExpressionEvaluator();
List<string> expressions = new List<string>()
"\"Hello\" + \" \" + \"World\"",
"Max(1+1, 2+3, 2*6, Pow(2, 3))",
"Array(2, $\"Test { 2 + 2 } U\", true).Length",
"Array(2, $\"Test { 2 + 2 } U\", true)[1]",
"Array(2, $\"Test { 2 + 2 } U\", true)[2] ? \"yes\" : \"no\"",
"false ? \"yes\" : \"no\"",
"Regex.Match(\"Test 34 Hello/-World\", @\"\\d+\").Value",
"int.Parse(Regex.Match(\"Test 34 Hello/-World\", @\"\\d+\").Value) + 2",
"new(Random).Next(1,10)",
"new Regex(@\"\\w*[n]\\w*\").Match(\"Which word contains the desired letter ?\").Value",
"List(\"Test\", \"Hello\", \"Bye\", \"How are you?\").Find(t => t.Length < 4)",
"new List<string>(){ \"Test\", \"Hello\", \"Bye\", \"How are you?\" }.Find(t => t.Length < 4)",
"Enumerable.Range(1,4).Cast().Sum(x =>(int)x)",
"Enumerable.Repeat(3,6).Cast().ToList().Count",
"Enumerable.Repeat(3,6).Cast().ToList()[4]",
"((x, y) => x * y)(4, 2)",
"\"Hello,Test,What\".Split(ArrayOfType(typeof(char), ',')).Length",
"\"Hello,Test,What\".Split(ArrayOfType(typeof(char), ','))[0]",
"\"Hello,Test,What\".Split(ArrayOfType(typeof(char), ','))[1]",
"\"Hello,Test,What\".Split(ArrayOfType(typeof(char), ','))[2]",
"\"Hello,Test,What\".Split(new char[] {','}).Length",
"\"Hello,Test,What\".Split(new char[] {','})[0]",
"\"Hello,Test,What\".Split(new char[] {','})[1]",
"\"Hello,Test,What\".Split(new char[] {','})[2]",
"new System.Xml.XmlDocument().FluidLoadXml(\"<root><element id='MyElement'>Xml Content</element></root>\").SelectSingleNode(\"//element[@id='MyElement']\").InnerXml",
"$\"https://www.google.ch/search?q={System.Net.WebUtility.UrlEncode(\"request with url encode() ?\")}\""
expressions.ForEach(expression =>
Console.WriteLine(expression);
Console.WriteLine(evaluator.Evaluate(expression));
Console.WriteLine(string.Empty);