java - Need a regular expression for a spreadsheet calculator -


i'm building calculator can operate on cells in spreadsheet, , need regular expression part of it.

what need parse out following:

  • digits: integers.
  • cell names: named 'alpha character' + 'digit' ie. a1, b2...
  • operations: +, -, *, /

an example like:

23 a4 * 2 b5 /   

here want groups be: 23, a4, *, 2, b5, /

it shouldn't tough, operations throw me off.

the reason wanting regex , not splitting on spaces validation. i'm looking specific things, thought regex best thing use.

here want groups be: 23, a4, *, 2, b5, /

string[] groups = "23 a4 * 2 b5 / ".split(" "); 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -