I want to implement a regex functionality which is, A user can add only one decimal point in a textbox which I mention in my code. I tried like below but it is not working.
NOTE The regex is proper, its tried and tested
$(function () {
$('input').on('#txtFiberActlength', function () {
match = (/(\d{0,2})[^.]*((?:\.\d{0,4})?)/g).exec(this.value.replace(/[^\d.]/g, ''));
this.value = match[1] + match[2];
});
});