Skip to content

Instantly share code, notes, and snippets.

@tuannha95
Last active November 2, 2020 02:29
Show Gist options
  • Save tuannha95/872f7a6d023836cffb25fe3b8a925342 to your computer and use it in GitHub Desktop.
Save tuannha95/872f7a6d023836cffb25fe3b8a925342 to your computer and use it in GitHub Desktop.
fun isVietnamesePhoneNumber(): Boolean {
phoneNumber.value?.let {
val pattern = "(03|07|08|09|01[2|6|8|9])+([0-9]{8})\\b".toRegex()
return pattern.matches(it)
}
return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment