Currently, I am using the following regular expression to validate currency in html input fields:
/[1-9]\d*(?:\.\d{0,2})?/
Suppose this allows the following value: 13000.234.12
This value is not valid. Here are the valid values ββthat I want to resolve through:
REALLY
125 1.25 1000.15 700.1 80.45 0.25
INVALID
130.1.4 21.......14
It seems that for this there should be a standard pattern of regular expression, thoughts?
Side note . I prevent alphanumeric and dollar signs through the event event listener, so they can no longer be entered, which should alleviate this problem. p>
source share