Last active
February 3, 2016 00:46
-
-
Save valbeat/6c43cacec9da63f5ebc7 to your computer and use it in GitHub Desktop.
都道府県と市町村区を分割し、配列に格納する。 ref: http://qiita.com/kajitack/items/d457fb4a811ddc53952a
This file contains 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
'東京都文京区本郷' | |
.replace(/^(.{2}[都道府県]|.{3}県)(.+)/, "$1 $2") | |
.split(' ') | |
// ['東京都','文京区本郷'] |
This file contains 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
'東京都文京区本郷' | |
.replace(/^(.{2}[都道府県]|.{3}県)(.+)/, "$1 $2") | |
.split(' ') | |
// ['東京都','文京区本郷'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment