My regular expression is designed to break down calculator input strings, such as 12+3.4x5
, into individual tokens like 12
, +
, 3.4
, x
, and 5
Here is the regular expression I am using:
\d+\.?\d+|[\+-÷x]
However, I am encountering unexpected matches with symbols like ^
and letters.