regex phone number france code example
Example 1: 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));
Example 2: regex find all french phone number python
^(?:(?:\+|00)33[\s.-]{0,3}(?:\(0\)[\s.-]{0,3})?|0)[1-9](?:(?:[\s.-]?\d{2}){4}|\d{2}(?:[\s.-]?\d{3}){2})$
Example 3: regex find all french phone number python
^
(?:(?:\+|00)33|0)
\s*[1-9]
(?:[\s.-]*\d{2}){4}
$