Created
May 30, 2018 21:33
-
-
Save DavidMellul/c4dc1730eb1021d808fac73ae3c5dd71 to your computer and use it in GitHub Desktop.
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
const uid = '6-DAVID-6'; | |
const regex = /^(\d)-.+-\1$/; | |
if( regex.test(uid) ) | |
console.log('It is a valid uid'); | |
// Prints : It is a valid uid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment