Only allow floating points regex
0
votes
3
answers
1097
views
How can I check if a specific string is a floating points?
This are possible floating points:
12.245
+.0009
3.11e33
43.1E11
2e-14
This is what I tried:
grep "^[+\-\.0-9]"
grep "^[+-]*[0-9]"
grep "^[+\-\.0-9]"
And other lots of related things, but none filtered anything at all. Almost every string got through. How would I tackle this problem?
Asked by O'Niel
(169 rep)
Oct 12, 2017, 07:41 PM
Last activity: Mar 7, 2024, 07:47 PM
Last activity: Mar 7, 2024, 07:47 PM