るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.143秒)
トップページ > クエリ:I[x] > クエリ:h[x] > バージョン:3.3[x] > クエリ:matched?[x]

別のキーワード

  1. _builtin to_h
  2. hash to_h
  3. env to_h
  4. ostruct to_h
  5. array to_h

ライブラリ

クラス

検索結果

StringScanner#matched? -> bool (81676.0)

前回のマッチが成功していたら true を、 失敗していたら false を返します。

前回のマッチが成功していたら true を、
失敗していたら false を返します。

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

s = StringScanner.new('test string')
s.matched? # => false
s.scan(/\w+/) # => "test"
s.matched? # => true
s.scan(/\w+/) # => nil
s.matched? # => false
s.scan(/\s+/) # => " "
s.matched? # => true
//}