Used for replace characters on keyup in javascript:
$(document).on("keyup", ".input", function(e) {
var target = $(e.target);
var value = target.val();
target.val(value.replace(/^-*\.+$||^\.+(?!$)|^0+(?=[0-9]+)|\.(?=\.|.+\.)|(?!^)-/g, ''));
});...
Submitted by anonymous - 7 years ago