Currently I have an expression:
numMatches = phone.match(/[^\d\s\-]/gi);
if (numMatches != null) {
alert(invPhnNo);
}
This gives an alert if any characters other than digit, space and hyphen are entered. But still accepts if only hyphen and spaces are given without a single digit. Now i would want it to alert if atleast a digit is not there. So a digit is mandatory. Can have zero or more spaces and hyphen and no other characters.
Can anyone suggest an approach to this?