Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active September 6, 2023 00:25
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 mcsee/f3df119d3be0cdfee7fddd6d725f92be to your computer and use it in GitHub Desktop.
Save mcsee/f3df119d3be0cdfee7fddd6d725f92be to your computer and use it in GitHub Desktop.
val prefix = "\\+"
val digit = "[0-9]"
val space = "[– -]"
val phoneRegex = Regex("^$prefix(?:$digit$space?){6,14}$digit$")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment