るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.028秒)
トップページ > モジュール:Kernel[x] > クエリ:gets[x] > クエリ:$[x] > ライブラリ:English[x]

別のキーワード

  1. _builtin gets
  2. irb/input-method gets
  3. io gets
  4. argf.class gets
  5. csv gets

キーワード

検索結果

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"...