This is the regular expression I use to match phone numbers like:
00 00 00 00 00 00 00 0 00 00 00 00 +00 0 00 00 00 00 (\\d{2}\\s+\\d{2}\\s+\\d{2}\\s+\\d{2}
Try this:
var re = /^\+?(\d{1,2} ?)+$/g var phone = "00 00 00 00 00"; //"00 00 00 00 00x"; if(!re.test(phone)) alert("wrong phone pattern");