Last active
August 1, 2017 07:15
-
-
Save NishiGaba/afbb2d44299c6d288986eb8a9dd2cfeb to your computer and use it in GitHub Desktop.
Regex for different combinations in Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Regex for only Alphanumeric Characters with Space Included | |
var regex = new RegExp("^[a-zA-Z ]+$"); | |
//Verifying Contact Number | |
var contact = 1234567890; | |
var isnum = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test(contact); | |
//You can Refer this site for more Regex or You can Create your own Regex : http://regexr.com/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment