Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Validations

I am currently doing a project for school in which I must validate the users phone number and e-mail.
I am using reg expressions but for some reason they won't work properly.
Here is the expression for the phone:
/d{3}-d{3}-d{4}/
can someone verify it for me and possibly correct it.

Here is the exprssion for the email:
/w{3,9}@w{3,9}.{1}w{2,3}/
Both of these function check to see if the value is null and they also check for invalid characters that can be introduced in the string sequence.
The remainder work but not this.

Thanks it would be appreciated.


Sign In or Register to comment.