So I have this string, that represents a math expression:
(timezone*timelapse)-time
Each word represents an id from an input field, and currently i was merely replacing each word with a prototype js expression to be evaled later:
$('timezone').value,
$('timelapse').value
The problem is the last id. By the time i reach it, my expression is currently like this:
($('timezone').value*$('timelapse').value)-time
So when I search for the word time to replace it with $('time').value it will affect the first two values and messing the final expression.
My question here is: How can I replace the correct word here?
Since this a math expression the word should probably be between any math symbols like this:
(+-/* **word** +-/*)
[empty space] **word** +-/*)
(*-/* **word** [empty space]
Or not?