monkeylee monkeylee - 11 months ago 59
jQuery Question

jquery validation regex for digits with hyphens

Can someone provide a regex that only allows digits and optionally hyphens

I have got as far as phone_number.match(/[0-9-]/); but with no luck


The following matches numbers interspersed with dashes, but not double dashes: