to delete non-decimal characters, you should be able to match every:
[^\.\d]
group returned.
([^.\d] should work - here a dot needn't be escaped)
The carat inverts inside brackets. It basically means "not a dot or a number".
Check out:
EDIT: I think this has your answer:
Restricting input to textbox: allowing only numbers and decimal point
EDIT 2: You could also use this:
var success = /^\d*\.?\d{0,2}$/.test(input);
as per:
Limiting input field to one decimal point and two decimal places
you can also demand a number before the decimal point like so:
var success = /^\d+\.?\d{0,2}$/.test(input); // uses + instead of *