Hi guys!! I've to make a program that reads an arithmetical sentence from a textbox, e.g 12.3*34+4*5-3 and then on another textbox identify and display what is the content of the first textbox, for example taking the last ex:
If I have this input:
12.3*34+4*5-3
The output should look like this:
<number>12.3
<operator> *
<number> 34
<operator> +
<number> 4
<operator> *
<number> 5
<operator> -
<number> 3
This program should only read this operators like (+,-,*,/).
I'm have in mind 2 ways of doing it, one with regex and the other taking the first sentence, put it on an array, then trim it, and somehow get the values of the array and identify if it is a number or a decimal number and if it's an operator and the display it.
The difficult part or the part that i can't conceptualize is how to implement it with regex (it should be easier with a regex format than storing it on a array).
Any help will be very appreciated,
Thanks in advanced!!