11件ヒット
[1-11件を表示]
(0.018秒)
別のキーワード
モジュール
- Kernel (11)
検索結果
-
Kernel
$ $ & -> String | nil (27109.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>"
//}...