Last active
May 25, 2021 13:46
-
-
Save AzrizHaziq/0031c0423799b579e258cab675505373 to your computer and use it in GitHub Desktop.
Common Malaysia Regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Malaysia new IC | |
const icRegEx = new RegExp(/\d{6}-\d{2}-\d{4}/) | |
icRegEx.test('931223-14-6957') // true | |
icRegEx.test('931223146957') // false | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
((Putrajaya) [1-9]\d{0,3}) (?# Putrajaya)
(H[ABCDEJKLMNPQRSTW][A-Y] [1-9]\d{0,3}) (?# Taxi)
(Z[ABCDLUZ] [1-9]\d{0,3}) (?# Military)
(LIMO [1-9]\d{0,3} [WB]) (?# LIMO)
(\d{2}-\d{2}-(DC|UN)) (?# DC&UN)
(Q[AKLRBMSCPT][A-Y] [1-9]\d{0,3} [A-Y]) (?# SArawak)
(L[A-Y] [1-9]\d{0,3}) (?# Labuan)
(S([YGSBKTDLU][A-Y]|A[A-C]|SA|TA) [1-9]\d{0,3} [A-Y]) (?#Sabah)
(KV [1-9]\d{0,3} [A-Y]) (?# Langkawi)
^(([ABCDFJKMNPRTW][A-Y]{1,2} [1-9]\d{0,3})(?<!(BAB 1))) (?# all except BAB 1)
WIP