るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. _builtin scan
  2. string scan
  3. strscan scan
  4. c scan
  5. rd scan

ライブラリ

クラス

検索結果

StringScanner#matched? -> bool (63448.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
//}