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-9\.]|^\.+(?!$)|^0+(?=[0-9]+)|\.(?=\.|.+\.)|(?!^)-/g, ''));
});