I'm looking to match individual characters from a calculation string such as:
(123+321)*1.15
The list of characters I'd like to match is:
0-9, ., +, -, *, /, (, ), %
Each character of the string will be passed into a function individually. I think I have the starting point (which works great with the numbers):
if (character.match(/[0-9]{1}/) !== null) {
// do something...
}
I'm not quite sure how to add the remaining characters though (I've always found regex confusing, even after reading countless articles on the subject).