るりまサーチ

最速Rubyリファレンスマニュアル検索!
402件ヒット [1-100件を表示] (0.079秒)

別のキーワード

  1. _builtin at
  2. _builtin values_at
  3. time at
  4. dbm values_at
  5. csv values_at

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

String#scan(pattern) -> [String] | [[String]] (18236.0)

self に対して pattern を繰り返しマッチし、 マッチした部分文字列の配列を返します。

...elf に対して pattern を繰り返しマッチし、
マッチした部分文字列の配列を返します。

pattern が正規表現で括弧を含む場合は、
括弧で括られたパターンにマッチした部分文字列の配列の配列を返します。

@param pattern 探索する...
...y]{
p "foobar".scan(/../) # => ["fo", "ob", "ar"]
p "foobar".scan("o") # => ["o", "o"]
p "foobarbazfoobarbaz".scan(/ba./) # => ["bar", "baz", "bar", "baz"]

p "foobar".scan(/(.)/) # => [["f"], ["o"], ["o"], ["b"], ["a"], ["r"]]

p "foobarbazfoobarbaz".scan(/(ba)(.)/) #...

String#scan(pattern) {|s| ... } -> self (18226.0)

pattern がマッチした部分文字列をブロックに渡して実行します。 pattern が正規表現で括弧を含む場合は、 括弧で括られたパターンにマッチした文字列の配列を渡します。

...pattern がマッチした部分文字列をブロックに渡して実行します。
pattern が正規表現で括弧を含む場合は、
括弧で括られたパターンにマッチした文字列の配列を渡します。

@param pattern 探索する部分文字列または正規表現

//em...
...list[例][ruby]{
"foobarbazfoobarbaz".scan(/ba./) {|s| p s }
# "bar"
# "baz"
# "bar"
# "baz"

"foobarbazfoobarbaz".scan("ba") {|s| p s }
# "ba"
# "ba"
# "ba"
# "ba"

"foobarbazfoobarbaz".scan(/(ba)(.)/) {|s| p s }
# ["ba", "r"]
# ["ba", "z"]
# ["ba", "r"]
# ["ba", "z"]
//}...

WEBrick::HTTPServer::MountTable#scan(path) -> Array (18202.0)

与えられたパスをスクリプトの名前と PATH_INFO に分割します。

...与えられたパスをスクリプトの名前と PATH_INFO に分割します。

@param path パスを指定します。...

Scanf::FormatSpecifier#match(str) (12101.0)

@todo

@todo

Scanf::FormatSpecifier#matched (12101.0)

@todo

@todo

絞り込み条件を変える

Scanf::FormatSpecifier#matched_string (12101.0)

@todo

@todo

Scanf::FormatSpecifier#mid_match? (12101.0)

@todo

@todo

Scanf::FormatString#last_match_tried (12101.0)

@todo

@todo

Scanf::FormatString#match(str) (12101.0)

@todo

@todo

Scanf::FormatString#matched_count (12101.0)

@todo

@todo

絞り込み条件を変える

StringScanner#post_match -> String | nil (9131.0)

前回マッチを行った文字列のうち、マッチしたところよりも後ろの 部分文字列を返します。前回のマッチが失敗していると常に nil を 返します。

...require 'strscan'

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

StringScanner#pre_match -> String | nil (9131.0)

前回マッチを行った文字列のうち、マッチしたところよりも前の 部分文字列を返します。前回のマッチが失敗していると常に nil を 返します。

...trscan'

s = StringScanner.new('test string')
s.pre_match # => nil
s.scan(/\w+/) # => "test"
s.pre_match # => ""
s.scan(/\w+/) # => nil
s.pre_match # => nil
s.scan(/\s+/) # => " "
s.pre_match # => "test"
s.scan(/\w+/) # => "string"
s.pre_match # => "test "
s.scan(/\w+/) # => nil
s.pre_matc...
<< 1 2 3 ... > >>