Parsing a postfix expression in C#, my naive approach






3.67/5 (5 votes)
Regex combined = new Regex(@"\G(\s+(?[+-*/])|\s*(?-?[0-9]+))", RegexOptions.ExplicitCapture);This line has an error:parsing "\G(\s+(?[+-*/])|\s*(?-?[0-9]+))" - [x-y] range in reverse order.
Regex combined = new Regex(@"\G(\s+(?This line has an error:[+-*/])|\s*(?<value>-?[0-9]+))", RegexOptions.ExplicitCapture);
parsing "\G(\s+(?<op>[+-*/])|\s*(?<value>-?[0-9]+))" - [x-y] range in reverse order.