The Phone Number Should Start with +65, Followed By 6|8|9 with Total of 11 Digits For Ex : +6598798765
Thank You
/\+65(6|8|9)\d{7}/g
\+
matches the character + literally (case sensitive)
65
matches the characters 65 literally (case sensitive)
1st Capturing Group (6|8|9)
\d{7}
matches a digit (equal to [0-9])
{7}
Quantifier — Matches exactly 7 times
|
character as @Tushar noted
You should use the cap(^) to indicate start of a string and EOS($) to specify the end of string.
var re=/^\+65(6|8|9)\d{7}$/;
var true_mob = "+6561234567";
var false_mob = "+6512345678";
console.log(re.test(true_mob));
console.log(re.test(false_mob));