Last active
December 16, 2015 19:49
-
-
Save SpringMT/5487305 to your computer and use it in GitHub Desktop.
Mac OS X scan
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
# scan test | |
## centos 6.3 ruby 2.0.0p0 | |
$ ruby -v | |
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux] | |
$ pry | |
[1] pry(main)> "123abcABCあいう".scan(/[[[:alpha:]]\w]/).map { |token| p token } | |
"1" | |
"2" | |
"3" | |
"a" | |
"b" | |
"c" | |
"A" | |
"B" | |
"C" | |
=> ["1", "2", "3", "a", "b", "c", "A", "B", "C"] | |
## centos 6.3 ruby 1.9.3p327 | |
$ ruby -v | |
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux] | |
$ pry | |
[1] pry(main)> "123abcABCあいう".scan(/[[[:alpha:]]\w]/).map { |token| p token } | |
"1" | |
"2" | |
"3" | |
"a" | |
"b" | |
"c" | |
"A" | |
"B" | |
"C" | |
"あ" | |
"い" | |
"う" | |
=> ["1", "2", "3", "a", "b", "c", "A", "B", "C", "あ", "い", "う"] | |
## Mac ruby 2.0.0p0 | |
$ ruby -v | |
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2] | |
$ pry | |
[1] pry(main)> "123abcABCあいう".scan(/[[[:alpha:]]\w]/).map { |token| p token } | |
"1" | |
"2" | |
"3" | |
"a" | |
"b" | |
"c" | |
"A" | |
"B" | |
"C" | |
=> ["1", "2", "3", "a", "b", "c", "A", "B", "C"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment