るりまサーチ

最速Rubyリファレンスマニュアル検索!
549件ヒット [501-549件を表示] (0.095秒)

別のキーワード

  1. json to_json
  2. json state
  3. json parser
  4. json generate
  5. json parse

ライブラリ

キーワード

検索結果

<< < ... 4 5 6 >>

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

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

...xp.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
p
rint $1
p
...
...rint $2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$OFS -> String | nil (21014.0)

$, の別名

...$, の別名

require "English"

array = %w|hoge fuga ugo bar foo|
p
array.join #=> "hogefugaugobarfoo"
$OUTPUT_FIELD_SEPARATOR = ","
p
array.join #=> "hoge,fuga,ugo,bar,foo"...

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

$* の別名

...$* の別名

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

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

Kernel$$LAST_READ_LINE -> String | nil (21008.0)

$_ の別名

...$_ の別名

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

ruby -rEnglish -ne'p $LAST_READ_LINE' a.txt
#=>
"1 e\n"
"2 f\n"
"3 g\n"
"4 h\n"
"5 i\n"...

Kernel$$MATCH -> String | nil (21008.0)

$& の別名

...$& の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/(foo|bar)/ =~ str
p
$MATCH #=> "foo"...

絞り込み条件を変える

<< < ... 4 5 6 >>