I am currently working on a JavaScript project to create a basic calculator. I am in need of a way to validate each item in an array of operands (sequences of digits) and operators (+, -, *, /, ** for power). I have managed to create regex patterns for digits (^\\d+$) and for the basic operands (^[\+\-\*\/\]$), but I am unsure how to incorporate the ** operand. How can I combine all these conditions to create a regex pattern that meets the requirements, such as "any sequence of digits OR any +, -, *, /, ** operand"? Your help is greatly appreciated!
Thank you!