Giter Club home page Giter Club logo

a-better-jp-phone-regex's Introduction

a-better-jp-phone-regex Build Status

A set of regular expressions for japanese phone numbers based on ministry of internal affairs (総務省) spec.

総務省のスペックをベースにした、日本国内の電話番号にマッチする正規表現。ほどよい厳密さを目指しています。

http://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/q_and_a.html

fixed phones - 固定電話

^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}$

mobile / PHS - 携帯とPHS

^0[789]0-?\d{4}-?\d{4}$

IP phones - IP電話

^050-?\d{4}-?\d{4}$

Combined - 合体バージョン

^(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})$

Usage - 使い方

You can use "index.js" as a common JS module, but it would be way faster to just copy-paste the content of "Combined" section above.

一応Common JSモジュールですが、上記の Cimbined の中の文字列をコピーして使うのが一番簡単だと思います。

a-better-jp-phone-regex's People

Contributors

msakata avatar sakatam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.