What's the right regex for matching the following criteria:
Examples that match:
Examples that shouldn't match:
Is such a thing possible?
Probably you can use this:
^ *((\d *- *\d)|(\d{2} *- *\d{2})|(\d{3} *- *\d{3})|(\d{4} *- *\d{4})|(\d{5} *- *\d{5})) *$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With