monkeylee monkeylee - 8 months ago 48
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: