I need a Javascript RegEx through which I can validate phone number. RegEx should handle following criteria
Try this:
function valid_phone_number(ph) { var regex = /^(?!([^-]*-){5})(\+\d+)?\s*(\(\d+\))?[- \d]+$/gi; return regex.test(ph); }
I'm new to regular expressions, so please be nice. :-)