Created
October 5, 2012 03:39
-
-
Save sakatam/3837932 to your computer and use it in GitHub Desktop.
a better (and not too explicit) set of regular expressions for japanese phone numbers
This file contains hidden or 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
// a better (and not too explicit) set of regular expressions for japanese phone numbers based on a spec defined by ministry of internal affairs (総務省). | |
// http://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/q_and_a-2001aug.html | |
// fixed phones | |
/^0(\d{1}-?\d{4}|\d{2}-?\d{3}|\d{3}-?\d{2}|\d{4}-?\d{1})-?\d{4}$/ | |
// mobile / PHS | |
/^0[789]0-?\d{4}-?\d{4}$/ | |
// IP phones | |
/^050-?\d{4}-?\d{4}$/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment