Am using jQuery to validate my form. How can I create a custom phone validation regular expression so that I can validate my phone field to accept numbers with hyphen and not in any particular order it may be 33333-23232, or 343-3434-343434, or in any form but it must have only numeric and hyphen.
I have tested with this var intRegex = /^[2-9]\d{2}-\d{3}-\d{4}$/;
but this is will be for a particular order like 999-999-9999.