るりまサーチ

最速Rubyリファレンスマニュアル検索!
372件ヒット [1-100件を表示] (0.038秒)
トップページ > クエリ:end[x] > 種類:変数[x]

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Kernel$$DEFAULT_INPUT -> IO (13.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$$ERROR_INFO -> Exception | nil (13.0)

$! の別名

...$! の別名

require "English"
class SomethingError < StandardError; end

begin
raise SomethingError
rescue
p $ERROR_INFO.backtrace #=> ["sample.rb:5"]
p $ERROR_INFO.to_s #=> "SomethingError"
end
...

Kernel$$ERROR_POSITION -> [String] | nil (13.0)

$@ の別名

...$@ の別名

require "English"
class SomethingError < StandardError; end

begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end
...

Kernel$$INPUT_LINE_NUMBER -> Integer (13.0)

$. の別名

...$. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5...

Kernel$$INPUT_RECORD_SEPARATOR -> String | nil (13.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$$LAST_PAREN_MATCH -> String | nil (13.0)

$+ の別名

...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>ikkou</td> <td><a href=http://localhost/link.html>link</a></td> </tr>
#enf of sample....

Kernel$$NR -> Integer (13.0)

$. の別名

...$. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5...

Kernel$$RS -> String | nil (13.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$$& -> String | nil (7.0)

現在のスコープで最後に成功した正規表現のパターンマッチでマッチした文字列です。 最後のマッチが失敗していた場合には nil となります。

...プかつスレッドローカル、読み取り専用です。
Ruby起動時の初期値は nil です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
p $&
end

#=> "<a href=\"http://example.com\">example.com</a>"
//}...
<< 1 2 3 ... > >>