るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.071秒)
トップページ > クエリ:ruby[x] > クエリ:Ruby[x] > クエリ:StringScanner[x] > クエリ:string[x] > クエリ:matched_size[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rubygems/defaults ruby_engine
  5. rake ruby

ライブラリ

クラス

検索結果

StringScanner#matched_size -> Integer | nil (42167.0)

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

...st[][ruby]{
require 'strscan'

def run(encode)
utf8 = "\u{308B 3073 3044}" # るびい
s = StringScanner.new(utf8.encode(encode))
s.scan(/#{"\u{308B}".encode(encode)}/)
s.matched_size
end

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

//}

//emlist[例][ruby]{
r...
...equire '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 # => nil
//}...

ruby 1.8.2 feature (7384.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...ruby 1.8.2 feature
ruby
1.8.2 での ruby 1.8.1 からの変更点です。

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。...
...以下は各変更点に付けるべきタグです。

*カテゴリ
* [ruby]: ruby インタプリタの変更
* [api]: 拡張ライブラリ API
* [lib]: ライブラリ
*レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更された...
.../magazine.rubyist.net/articles/0002/0002-RubyCore.html>))
* tk の変更点は
((<URL:https://magazine.rubyist.net/articles/0003/0003-RubyTkMovement.html>))
を参照して下さい。
* soap, wsdl の変更点は
((<URL:http://rrr.jin.gr.jp/projects/soap4r/wiki/Changes-ruby181_ruby182>))...