22件ヒット
[1-22件を表示]
(0.188秒)
キーワード
-
$ & # 39; (11) -
$ POSTMATCH (11)
検索結果
-
Kernel
$ $ POSTMATCH -> String | nil (9201.0) -
$' の別名
...$' の別名
require "English"
str = 'hoge,foo,bar,hee,hoo'
/foo/ =~ str
p $POSTMATCH #=> ",bar,hee,hoo"... -
Kernel
$ $ & # 39; -> String | nil (3107.0) -
現在のスコープで最後に成功した正規表現のパターンマッチでマッチした 部分より後ろの文字列です。 最後のマッチが失敗していた場合には nil となります。
...。
Regexp.last_match.post_match と同じです。
この変数はローカルスコープかつスレッドローカル、読み取り専用です。
Ruby起動時の初期値は nil です。
//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)"......>(.*?)</a>] =~ str
p $'
end
#=> "</p>"
//}...