Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js nepali phone number validation regex

function validateNepaliPhoneNoFormat(phoneNumber) {
	let regexPhoneNo = /^[+]?[+]?[0-9]{3}[-]?[0-9]{10}$/;
	console.log(regexPhoneNo, phoneno);
	if (phoneno.match(regexPhoneNo)) {
		return true;
	} else {
		return false;
	}
}
var phoneNumber = +977-9876543210; 
// or 
var phoneNumber = +9779876543210;
console.log(validateNepaliPhoneNoFormat(phoneNumber))
 
PREVIOUS NEXT
Tagged: #js #nepali #phone #number #validation #regex
ADD COMMENT
Topic
Name
3+1 =