るりまサーチ

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

別のキーワード

  1. kernel test
  2. _builtin test
  3. rubygems/test_utilities tempio
  4. rubygems/test_utilities fetcher=
  5. testtask test_files=

ライブラリ

クラス

検索結果

StringScanner#matched_size -> Integer | nil (18156.0)

前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。

.../)
s.matched_size
end

p
run("UTF-8") #=> 3
p
run("EUC-JP") #=> 2
p
run("Shift_Jis") #=> 2

//}

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
s.matched_size # => nil
s.scan(/\w+/) # => "test"
s.matched_size # => 4
s.scan(/\w+/) # => nil
s.matched_size # =>...