Hi & help,
I'm trying to parse arithmetic expressions such as 4*(7-2.1).
The first thing I'm trying is to add spaces to get: 4 * ( 7 - 2.1 ).
I thought that Regular Expressions would be the way to go. I tried:
regex.replace("\D", " \D ") which did not work. I don't know how to refer
to the string that was matched in forming the replacement.
Also, I tried regex.replace("+*", " +* ") This was even worse because I'm
apparently not using a recognizable syntax.
Did I mention that this is my first attempt at regular expressions?
I'd really appreciate any suggestions.
Art