JavaScript RegEx expresssion -


i need compose expression allow number or decimal point, 1 decimal.

allowed formats

100.00, 100

but not

'100d.00, a100, -100, 100.000.000.00' 

for goal, far have this:

/[^0-9$.]/g 

any community appreciated.

i think /^\d+(\.\d{2})?$/ should work. if need more 2 digits after decimal point /^\d+(\.\d+)?$/.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -