Skip to content

Instantly share code, notes, and snippets.

@tungvn
Last active November 24, 2025 09:45
Show Gist options
  • Select an option

  • Save tungvn/2460c5ba947e5cbe6606c5e85249cf04 to your computer and use it in GitHub Desktop.

Select an option

Save tungvn/2460c5ba947e5cbe6606c5e85249cf04 to your computer and use it in GitHub Desktop.
Vietnamese phone number Regex validation
/*
Before Septemper 15 2018, Vietnam has phone number start with 09*, 01(2|6|8|9).
After that, the phone number can start with 03, 05, 07 or 08.
So this function provide a way to validate the input number is a Vietnamese phone number
*/
function isVietnamesePhoneNumber(number) {
return /(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number);
}
@vhbui02
Copy link

vhbui02 commented Aug 7, 2025

Cảm ơn các bác nhé.

@supercode221
Copy link

E cảm ơn các bác ạ cú em một bàn thua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment