Created
April 30, 2014 16:14
-
-
Save letusfly85/f22e96622132b8d9ba05 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
# encoding: utf-8 | |
str = " | |
abc | |
def | |
ghi | |
jkl | |
mno | |
pqr | |
stu | |
" | |
#改行以外を抜き出す | |
result = str.scan(/([^\n]+)/) | |
print result | |
# アウトプットはWindowsで以下 | |
# | |
# [["abc"], ["def"], ["ghi"], ["jkl"], ["mno"], ["pqr"], ["stu"]] | |
# | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment