るりまサーチ

最速Rubyリファレンスマニュアル検索!
670件ヒット [601-670件を表示] (0.122秒)
トップページ > クエリ:ruby[x] > クエリ:E[x] > モジュール:Kernel[x] > 種類:変数[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < ... 5 6 7 >>

Kernel$$7 -> String | nil (3008.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>]...
...=~ str
print $1
print $2
e
nd
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$8 -> String | nil (3008.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>]...
...=~ str
print $1
print $2
e
nd
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$9 -> String | nil (3008.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>]...
...=~ str
print $1
print $2
e
nd
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$= -> bool (3008.0)

過去との互換性のために残されていますが、もはや何の意味もありません。

...

値は常に false です。代入しても無視されます。

この変数はグローバルスコープです。

//emlist[例][ruby]{
$= = true # => warning: variable $= is no longer effective; ignored
$= # => warning: variable $= is no longer effective
# false
//}...

Kernel$$ARGV -> [String] (3008.0)

$* の別名

...$* の別名

require "English"
p $ARGV
# end of sample.rb

ruby
sample.rb 31 /home/hoge/fuga.txt
#=> ["31", "/home/hoge/fuga.txt"]...

絞り込み条件を変える

Kernel$$ORS -> String | nil (3008.0)

$\ の別名

...$\ の別名

require "English"

print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb

ruby
sample.rb
hoge
huga
fuge
ugo...
<< < ... 5 6 7 >>