2019-09-11
RegEx needed to match number to 2 decimal places
stackoverflow
Question

I need some regex that will match only numbers that are decimal to two places. For example

123 = No match

12.123 = No match

12.34 = Match

Answer
1
^[0-9]*\.[0-9]{2}$ or ^[0-9]*\.[0-9][0-9]$
RegEx needed to match number to 2 decimal places
See more ...