るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.088秒)
トップページ > ライブラリ:ビルトイン[x] > クエリ:_builtin[x] > クエリ:inspect[x] > クエリ:p[x] > クラス:MatchData[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

MatchData#inspect -> String (32228.0)

self の内容を人間に読みやすい文字列にして返します。

...ruby]{
p
uts /.$/.match("foo").inspect
# => #<MatchData "o">

p
uts /(.)(.)(.)/.match("foo").inspect
# => #<MatchData "foo" 1:"f" 2:"o" 3:"o">

p
uts /(.)(.)?(.)/.match("fo").inspect
# => #<MatchData "fo" 1:"f" 2:nil 3:"o">

p
uts /(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").inspect
# => #<MatchData "hog...