48件ヒット
[1-48件を表示]
(0.028秒)
キーワード
-
$ DEFAULT _ INPUT (12) -
$ INPUT _ RECORD _ SEPARATOR (12) -
$ LAST _ PAREN _ MATCH (12) -
$ RS (12)
検索結果
先頭4件
-
Kernel
$ $ INPUT _ RECORD _ SEPARATOR -> String | nil (6117.0) -
$/ の別名
...
$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo... -
Kernel
$ $ RS -> String | nil (6117.0) -
$/ の別名
...
$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo... -
Kernel
$ $ DEFAULT _ INPUT -> IO (6116.0) -
$< の別名
...
$< の別名
require "English"
while line = $DEFAULT_INPUT.gets
p line
end
# end of sample.rb
ruby sample.rb < /etc/passwd
# => "hoge:x:500:501::/home/hoge:/bin/bash\n"
...... -
Kernel
$ $ LAST _ PAREN _ MATCH -> String | nil (6116.0) -
$+ の別名
...
$+ の別名
require "English"
r1 = Regexp.compile("<img src=(http:.+?)>")
r2 = Regexp.compile("<a href=(http|ftp).+?>(.+?)</a>")
while line = DATA.gets
[ r1, r2 ].each {|rep|
rep =~ line
p $+
}
end
__END__
<tr> <td><img src=http://localhost/a.jpg></td> <td>ikko......u</td> <td><a href=http://localhost/link.html>link</a></td> </tr>
#enf of sample.rb
$ ruby sample.rb
"http://localhost/a.jpg"
"link"...