Right now I have a regex where it checks if the string in a decimal format or not:
-?\d+(?:.\d+)//any positive or negative number, including decimals
If I wanted to create a regex for a fraction, which may also consist of decimals, such as:
- 3.1/2.6
- 1.00/5.00
Would the following be valid?
-?\(d+(?:.\d+)|d+(?:.\d+)/d+(?:.\d+))//a decimal OR a fraction(including decimals)
See Question&Answers more detail:os