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:
Would the following be valid?
-?\(d+(?:.\d+)|d+(?:.\d+)/d+(?:.\d+))//a decimal OR a fraction(including decimals)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…