Click here to Skip to main content
11,632,450 members (76,794 online)
Click here to Skip to main content

Tagged as

Parsing a postfix expression in C#, my naive approach

, 19 Dec 2010 CPOL 4K 1
Rate this:
Please Sign up or sign in to vote.
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+(?<op>[+-*/])|\s*(?<value>-?[0-9]+))", RegexOptions.ExplicitCapture);</op>

This line has an error:
parsing "\G(\s+(?<op>[+-*/])|\s*(?<value>-?[0-9]+))" - [x-y] range in reverse order.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

YangChunJiang
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralI expect it is the - in the first group.. changing it to [-+... Pin
Morten Nilsen21-Dec-10 0:32
memberMorten Nilsen21-Dec-10 0:32 
GeneralReason for my vote of 1 This is a valid comment, but doesn't... Pin
Darchangel6-Dec-10 2:53
memberDarchangel6-Dec-10 2:53 
GeneralReason for my vote of 1 This is really a comment, not an Alt... Pin
Toli Cuturicu4-Dec-10 7:42
memberToli Cuturicu4-Dec-10 7:42 
Reason for my vote of 1
This is really a comment, not an Alternate, isn't it?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150728.1 | Last Updated 19 Dec 2010
Article Copyright 2010 by YangChunJiang
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid