るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. cgi out
  2. cgi/core out
  3. zlib total_out
  4. zlib avail_out
  5. zlib avail_out=

ライブラリ

キーワード

検索結果

MatchData#begin(n) -> Integer | nil (25.0)

n 番目の部分文字列先頭のオフセットを返します。

...範囲外の n を指定した場合に発生します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.begin(0) # => 0
p $~.begin(1) # => 0
p $~.begin(2) # => 3
p $~.begin(3) # => nil
p $~.begin(4) # => `begin': index 4 out of matches (IndexError)
//}

@see MatchData#end...

MatchData#end(n) -> Integer | nil (25.0)

n 番目の部分文字列終端のオフセットを返します。

...IndexError 範囲外の n を指定した場合に発生します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.end(0) # => 6
p $~.end(1) # => 3
p $~.end(2) # => 6
p $~.end(3) # => nil
p $~.end(4) # => `end': index 4 out of matches (IndexError)
//}

@see MatchData#begin...