るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.011秒)
トップページ > モジュール:Kernel[x] > クエリ:=~[x] > クエリ:kernel$~[x]

別のキーワード

  1. _builtin =~
  2. string =~
  3. regexp =~
  4. symbol =~
  5. platform =~

ライブラリ

検索結果

Kernel$$~ -> MatchData | nil (3007.0)

現在のスコープで最後に成功したマッチに関する MatchDataオブジェクトです。 Regexp.last_match の別名です。

...ます。

この変数はローカルスコープかつスレッドローカルです。
Ruby起動時の初期値は nil です。

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