Created
November 14, 2017 08:14
-
-
Save FahmiRaazali/814164dee022b0d6d530b98d55cdb418 to your computer and use it in GitHub Desktop.
[Regex Malaysia Mobile Phone Number] #regex
This file contains hidden or 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
| /^(\+?6?01)[0|1|2|3|4|6|7|8|9]\-*[0-9]{7,8}$/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
combining both ideas from @FahmiRaazali and @sagorzaii and also without repeating dashes. Also, removed the extra
\before dash to make it usable for HTML pattern attribute.^(\+?6?01|\+?6?0)[0-9]-?[0-9]{7,8}$This modified regex will match all the following numbers below: