るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.034秒)
トップページ > バージョン:2.3.0[x] > 種類:インスタンスメソッド[x] > クエリ:l[x] > ライブラリ:strscan[x] > クエリ:[][x] > クラス:StringScanner[x]

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

検索結果

StringScanner#[](nth) -> String | nil (54613.0)

前回マッチした正規表現の nth 番目のかっこに対応する部分文字列を 返します。インデックス 0 はマッチした部分全体です。前回のマッチが 失敗していると常に nil を返します。

...した正規表現の nth 番目のかっこに対応する部分文字列を
返します。


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

s = StringScanner.new('test string')
s.scan(/\w(\w)(\w*)/) # => "test"
s[0] # => "test"
s[1] # => "e"
s[2]...