Jump to content

validating numbers


l0ve2hat3

Recommended Posts

i just want to know the string to use to determin numbers and - only... no specific order...

 

123-123-1234 is valid

12-1234-4561 is valid

111111111 is vaild

 

(454) 456-4564 is NOT valid

cell- 212-4564-4564 is NOT valid

-------- is NOT valid

 

this is what i came up with, but it doesnt work

$test="/(\d+\-?)/"

 

Please help...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.