るりまサーチ

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

別のキーワード

  1. rc4 new
  2. rc2 new
  3. rc5 new
  4. openssl rc2
  5. openssl rc4

ライブラリ

クラス

検索結果

Ripper.slice(src, pattern, n = 0) -> String | nil (18207.0)

Ruby プログラム src のうち、 パターン pattern の n 番目の括弧にマッチする文字列を取り出します。

...Ruby プログラム src のうち、
パターン pattern の n 番目の括弧にマッチする文字列を取り出します。

マッチしない場合は nil を返します。

@param src Ruby プログラムを文字列か IO オブジェクトで指定します。

@param pattern 取り...
...
その他のメタ文字もすべて文字単位ではなくトークン単位で動作します。

使用例

require 'ripper'
p Ripper.slice(%(<<HERE\nstring\#{nil}\nHERE),
"heredoc_beg .*? nl $(.*?) heredoc_end", 1)
# => "string\#{nil}\n"

イベント ID は Rippe...