This project is read-only.
1
Vote

Can it parse Regex.Replace with lambda MatchEvaluator

description

following is example:

Person person = new Person {Name = "test example"};
Regex.Replace(person.Name, @"(^\w)|(\s\w)", m => m.Value.ToUpper()); // result: "Test Example"

// using Lambda Expression Parser, got exception at ep.Parse(exp)
         ExprParser.Using.Add("System.Text.RegularExpressions");
        ExprParser.Using.Add("ConsoleApplication1");
        ExprParser ep = new ExprParser();
       string exp = "(Person p) => Regex.Replace(p.Name, \"(^\\\\w)|(\\\\s\\\\w)\",m => m.Value.ToUpper())";
        lambda = ep.Parse(exp);  // this parser does not work
        var result = (string)ep.Run(lambda, person ); 
any idea?

comments