Skip to content

Instantly share code, notes, and snippets.

@tungvn
Last active August 7, 2025 11:59
Show Gist options
  • Save tungvn/2460c5ba947e5cbe6606c5e85249cf04 to your computer and use it in GitHub Desktop.
Save tungvn/2460c5ba947e5cbe6606c5e85249cf04 to your computer and use it in GitHub Desktop.

Revisions

  1. tungvn revised this gist Dec 16, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions regex-vietnamese-phone-number-updated-2018.js
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    /*
    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, 07 or 08.
    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|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number);
    return /(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number);
    }
  2. tungvn created this gist Oct 25, 2018.
    9 changes: 9 additions & 0 deletions regex-vietnamese-phone-number-updated-2018.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    /*
    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, 07 or 08.
    So this function provide a way to validate the input number is a Vietnamese phone number
    */

    function isVietnamesePhoneNumber(number) {
    return /(03|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number);
    }