Skip to content

Instantly share code, notes, and snippets.

@eneim
Created February 23, 2015 03:37
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 eneim/2260655317867e40369a to your computer and use it in GitHub Desktop.
Save eneim/2260655317867e40369a to your computer and use it in GitHub Desktop.
Japanese Phone regex
With hyphens:
^(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})$
Without hyphens:
^(0([1-9]{1}[1-9]\d{3}|[1-9]{2}\d{3}|[1-9]{2}\d{1}\d{2}|[1-9]{2}\d{2}\d{1})\d{4}|0[789]0\d{4}\d{4}|050\d{4}\d{4})$
Source: https://github.com/sakatam/a-better-jp-phone-regex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment