1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| //Fixe
const fixe = "02 212 34 69";
const fixe1 = "02/2123469";
const fixe2 = "+322212 34 69";
const fixe3 = "+322123469";
const fixe4 = "022123469";
const fixe5 = "0221234694";
const fixe6 = "003223334455";
const regexFixe = new RegExp("^[0-9/?+?\ ?]{9,13}$");
//Mobile
const mobile = "0412 12 12 12";
const mobile1 = "0412121212";
const mobile2 = "0412 121 212";
const mobile3 = "+32 412 121 121";
const mobile4 = "+32 412 12 11 21";
const mobile5 = "0032 412 121 121";
const mobile6 = "0032 412 12 11 21";
const mobile7 = "0032412121121";
const mobile8 = "0412/121121";
const regexMobile2 = new RegExp("^[0-9+/? ?]{10,17}$");
console.log("Valeur: "+regexMobile2.test(mobile)); |
Partager