I am using the following regex to validate decimal numbers with dot .
/^[0-9]*\.?[0-9]*$/
It works fine for all the cases except the case 12.
Working Example:
12
12.2
10.222
12.
I want to throw validation error when user enters (12.
): at least a digit after decimal point needs to be entered (like 12.1
).