るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.069秒)
トップページ > クエリ:string[x] > クエリ:match[x] > 種類:クラス[x]

別のキーワード

  1. string []=
  2. string slice
  3. string []
  4. string slice!
  5. string gsub!

ライブラリ

キーワード

検索結果

MatchData (6025.0)

正規表現のマッチに関する情報を扱うためのクラス。

...正規表現のマッチに関する情報を扱うためのクラス。

このクラスのインスタンスは、
* Regexp.last_match
* Regexp#match, String#match
* $~
などにより得られます。...

Rinda::Template (67.0)

タプルのマッチングのためのクラスです。 ユーザがこのクラスを直接使うことはありません。

...ate.match(['abc', 2, 5]) # => true
template.match(['hoge', 2, 5]) # => false

template = Rinda::Template.new([String, Integer, nil])
template.match(['abc', 2, 5]) # => true
template.match(['abcd', 2, 5]) # => true

template = Rinda::Template.new([/^abc/, Integer, nil])
template.match([/...
..., nil]) # => true
template.match(['abc', 2, 5]) # => true
template.match(['def', 2, 5]) # => false

template = Rinda::Template.new({'name' => String, 'age' => Integer})
template.match({'name' => 'seki', 'age' => 0x20}) # => true
template.match({'name' => :seki, 'age' =>...

CSV (55.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...込み
csv_string = CSV.generate do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end
//}

=== 一行変換

//emlist[][ruby]{
require 'csv'

csv_string = ["CSV", "data"].to_csv # => "CSV,data"
csv_array = "CSV,String".parse_csv # => ["CSV", "String"]
//}

===...
...%w{my data here} } # to a String
CSV($stderr) { |csv_err| csv_err << %w{my data here} } # to $stderr
//}

=== CSV と文字エンコーディング (M17n or Multilingualization)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or...
...scoded
(unless you ask Ruby to transcode it for you) and will literally be parsed in
the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
Encoding of your data. This is accomplished by transcoding the parser itself
into your Encoding.

Some transcoding must take place, of c...

Regexp (13.0)

正規表現のクラス。正規表現のリテラルはスラッシュで囲んだ形式 で記述します。

...]{
/^this is regexp/
//}

Regexp.new(string) を使って正規表現オブジェクトを動的に生成する
こともできます。

//emlist[][ruby]{
str = "this is regexp"
rp1 = Regexp.new("^this is regexp")
p rp1 =~ str # => 0
p Regexp.last_match[0] # => "this is regexp"
//}


spec...
...]{
/^this is regexp/
//}

Regexp.new(string) を使って正規表現オブジェクトを動的に生成する
こともできます。

//emlist[][ruby]{
str = "this is regexp"
rp1 = Regexp.new("^this is regexp")
p rp1 =~ str # => 0
p Regexp.last_match[0] # => "this is regexp"
//}

Ruby...