I need the regex in PHP for the currency with decimal.
I would like to match only numbers with decimal points. There should be 2 numbers after the decimal point.
I am using preg_match('/^[0-9]+(?:\.[0-9]+)?$/', $amt)
. However, in this amount 100 is also validating correctly, which should not be the case.
Correct
100.00
5676.00
Wrong
Alpha Characters
100
100,00
+/- 100
Thank you in advance.