I need a regex expression that will match the following:
.5 0.5 1.5 1234
but NOT
0.5.5 absnd (any letter character or space
Nobody seems to be accounting for negative numbers. Also, some are creating a capture group which is unnecessary. This is the most thorough solution IMO.
^[+-]?(?:\d*\.)?\d+$