monkeylee monkeylee - 2 months ago 14x
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: