1function regexPhoneNumber(str) {
2 const regexPhoneNumber = /^((\+)33|0)[1-9](\d{2}){4}$/;
3
4 if (str.match(regexPhoneNumber)) {
5 return true;
6 } else {
7 return false;
8 }
9}
10
11let phoneNumber = "+33777777777";
12console.log(regexPhoneNumber(phoneNumber));