Last active
February 9, 2023 15:20
-
-
Save Ayubur/b58e4d2d7b83e7ef3f696b27c4651e5c to your computer and use it in GitHub Desktop.
Javascript mobile number validation RegExp example
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
//RegExp of mobile number validtion | |
let countryCode = '880'; //mobile country code | |
let numberLength=10; //length of mobile number | |
let mobilePattern = `^((\\+${countryCode}-?)|0)?[0-9]{${numberLength.toString()}}$`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment