+33 only is for metropolitan France.
I think you can also add overseas France with
/^(?:(?:\+|00|0)((262|692)|(263|693)|508|(5|6)90|(5|6)94|(5|6|7)96|681|687|689))(?:[\s.-]*\d{2}){3,4}$/
If you consider digits length difference between overseas territories as well as some specific area codes for mobile, the regex becomes really messy...
The function I'm currently using in JS :
export const isValidFrenchPhoneNumber = (phonenumber) => {
const metropolitanFranceReg = new RegExp(/^(?:(?:\+|00)33|0)\s*[1-9](?:[\s.-]*\d{2}){4}$/)
const overseasFranceReg = new RegExp(/^(?:(?:\+|00|0)((262|692)|(263|693)|508|(5|6)90|(5|6)94|(5|6|7)96|681|687|689))(?:[\s.-]*\d{2}){3,4}$/)
// src: https://en.wikipedia.org/wiki/Telephone_numbers_in_France
// 262, 263 = La Réunion, Mayotte and IO territories ; 508 = Saint-Pierre-et-Miquelon
// 590 = Guadeloupe, Saint-Martin et Saint-Barthélemy ; 594 = French Guiana (Guyane) ; 596 = Martinique
// 681 = Wallis-et-Futuna ; 687 = Nouvelle-Calédonie
// 689 = French Polynesia
return !(phonenumber.match(metropolitanFranceReg) === null) || !(phonenumber.match(overseasFranceReg) === null)
}
07
?^(((\+33\s)|0)[1-9]\s([0-9][0-9]\s){4})$
may do the trick but it's quite complex and is just and modification from yours (obligation to put space between two digits), but0033
isn't allowed?