Skip to content

Instantly share code, notes, and snippets.

@SangHakLee
Last active June 13, 2017 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SangHakLee/a1c8bec3e32578d03867e5d7beb1f45b to your computer and use it in GitHub Desktop.
Save SangHakLee/a1c8bec3e32578d03867e5d7beb1f45b to your computer and use it in GitHub Desktop.
isMobilePhone
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