Amith Amith - 2 months ago 27
Javascript Question

regular expression in javascript which allows backspace

My regular expression which allows characters, numbers, dot and underscore is

var numericReg = /^[a-zA-Z0-9\._]+$/;

How could i allow backspace in this reg ex.?


The optimal solution for this problem is to check the value of textbox >0 before validating. This will help to solve error showing while pressing backspace in an empty textbox..!!