Answers for "us phone number js regex"

2

javascript regex french phone number

function regexPhoneNumber(str) {
	const regexPhoneNumber = /^((\+)33|0)[1-9](\d{2}){4}$/; 
  
	if (str.match(regexPhoneNumber)) {
		return true;
	} else {
		return false;
	}
}

let phoneNumber = "+33777777777";
console.log(regexPhoneNumber(phoneNumber));
Posted by: Guest on March-26-2020

Code answers related to "us phone number js regex"

Code answers related to "Javascript"

Browse Popular Code Answers by Language