Last active
June 13, 2017 16:04
-
-
Save SangHakLee/a1c8bec3e32578d03867e5d7beb1f45b to your computer and use it in GitHub Desktop.
isMobilePhone
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
const isMobilePhone = /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/; | |
valid: [ | |
'+82-010-1234-5678', | |
'+82-10-1234-5678', | |
'82-010-1234-5678', | |
'82-10-1234-5678', | |
'+82 10 1234 5678', | |
'010-123-5678', | |
'10-1234-5678', | |
'+82 01 1234 5678', | |
'011 1234 5678', | |
'+820112345678', | |
'01012345678', | |
], | |
invalid: [ | |
'1', | |
'', | |
'+82 10 1234 567', | |
'+82 10o 1234 1234', | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment