るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

キーワード

検索結果

Kernel$$POSTMATCH -> String | nil (9201.0)

$' の別名

...$' の別名

require "English"

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

/foo/ =~ str
p $POSTMATCH #=> ",bar,hee,hoo"...

Kernel$$' -> 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 $'
e
nd
#=> "</p>"
//}...