Created
August 17, 2014 21:23
-
-
Save memetor/4f78c0b993ee38f54e13 to your computer and use it in GitHub Desktop.
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
ZEN_KAKU_NUM = %w(0 1 2 3 4 5 6 7 8 9) | |
HAN_KAKU_MAP = ZEN_KAKU_NUM.map.with_index {|n, i| Hash[n, i.to_s]}.reduce(&:merge) | |
%(0120x).gsub(/[#{ZEN_KAKU_NUM}]/, HAN_KAKU_MAP) | |
# => 0120x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment