るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

検索結果

MatchData#byteend(n) -> Integer | nil (24376.0)

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

...バイトオフセットを返します。

@
param n 部分文字列を指定する数値。
@
param name 名前付きキャプチャを指定する文字列またはシンボル。

@
raise IndexError 範囲外の n を指定した場合に発生します。
@
raise IndexError 正規表現中で定義...
...ist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.byteend(0) # => 15
p $~.byteend(1) # => 3
p $~.byteend(2) # => 12
p $~.byteend(3) # => 15
p $~.byteend(4) # => index 4 out of matches (IndexError)
//}

//emlist[...
...シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.byteend(:key) # => 4
$~.byteend(:value) # => 10
$~.byteend(:foo) # => undefined group name reference: foo (IndexError)
//}...

MatchData#byteend(name) -> Integer | nil (24376.0)

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

...バイトオフセットを返します。

@
param n 部分文字列を指定する数値。
@
param name 名前付きキャプチャを指定する文字列またはシンボル。

@
raise IndexError 範囲外の n を指定した場合に発生します。
@
raise IndexError 正規表現中で定義...
...ist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.byteend(0) # => 15
p $~.byteend(1) # => 3
p $~.byteend(2) # => 12
p $~.byteend(3) # => 15
p $~.byteend(4) # => index 4 out of matches (IndexError)
//}

//emlist[...
...シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.byteend(:key) # => 4
$~.byteend(:value) # => 10
$~.byteend(:foo) # => undefined group name reference: foo (IndexError)
//}...