るりまサーチ

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

別のキーワード

  1. _builtin to_c
  2. etc sc_2_c_dev
  3. etc sc_2_c_bind
  4. tracer display_c_call
  5. tracer display_c_call=

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

MatchData#offset(name) -> [Integer, Integer] | [nil, nil] (21152.0)

name という名前付きグループに対応する部分文字列のオフセットの配列 [start, end] を返 します。

...~.offset('year') # => [0, 4]
p $~.offset(:year) # => [0, 4]
p $~.offset('month') # => [5, 6]
p $~.offset(:month) # => [5, 6]
p $~.offset('day') # => [nil, nil]
p $~.offset('century') # => `offset': undefined group name reference: century (IndexError)
//}

@see MatchData#begin, MatchD...
...ata#end, MatchData#offset...

Psych::SyntaxError#offset -> Integer (21124.0)

エラーが生じた位置の offset をバイト数で 返します。

...エラーが生じた位置の offset をバイト数で
返します。

offset
とは、
Psych::SyntaxError#line, Psych::SyntaxError#column
で指示される位置からの相対位置です。
この位置から 0 バイトの位置でエラーが発生することが多いため、
このメ...

MatchData#offset(n) -> [Integer, Integer] | [nil, nil] (21117.0)

n 番目の部分文字列のオフセットの配列 [start, end] を返 します。

...lf.begin(n), self.end(n) ]
//}

と同じです。n番目の部分文字列がマッチしていなければ
[nil, nil] を返します。

@param n 部分文字列を指定する数値

@raise IndexError 範囲外の n を指定した場合に発生します。

@see MatchData#begin, MatchData#end...
...end(n) ]
//}

と同じです。n番目の部分文字列がマッチしていなければ
[nil, nil] を返します。

@param n 部分文字列を指定する数値

@raise IndexError 範囲外の n を指定した場合に発生します。

@see MatchData#begin, MatchData#end, MatchData#offset...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (12219.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフ...
...source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incompl...
...:undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (12219.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフ...
...source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incompl...
...:undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (12219.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフ...
...source buffer may be part of larger source
:after_output => true # stop conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incompl...
...:undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive...

Time#utc_offset -> Integer (9215.0)

協定世界時との時差を秒を単位とする数値として返します。

...合][ruby]{
p Time.now.zone # => "JST"
p Time.now.utc_offset # => 32400
//}

タイムゾーンが協定世界時に設定されている場合は 0 を返します。

//emlist[協定世界時の場合][ruby]{
p Time.now.getgm.zone # => "UTC"
p Time.now.getgm.utc_offset # => 0
//}...

MatchData#byteoffset(name) -> [Integer, Integer] | [nil, nil] (9114.0)

name という名前付きグループに対応する部分文字列のバイト単位のオフセットの 配列 [start, end] を返します。

...eoffset('year') # => [0, 4]
p $~.byteoffset(:year) # => [0, 4]
p $~.byteoffset('month') # => [7, 8]
p $~.byteoffset(:month) # => [7, 8]
p $~.byteoffset('day') # => [nil, nil]
p $~.byteoffset('century') # => `offset': undefined group name reference: century (IndexError)
//}

@see Matc...
...hData#offset...

MatchData#byteoffset(n) -> [Integer, Integer] | [nil, nil] (9109.0)

n 番目の部分文字列のバイト単位のオフセットの 配列 [start, end] を返します。

...のオフセットの
配列 [start, end] を返します。

n番目の部分文字列がマッチしていなければ [nil, nil] を返します。

@param n 部分文字列を指定する数値

@raise IndexError 範囲外の n を指定した場合に発生します。

@see MatchData#offset...

Regexp#match(str, pos = 0) -> MatchData | nil (6213.0)

指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。

...atchData オブジェクトで返し
ます。
マッチしなかった場合 nil を返します。

省略可能な第二引数 pos を指定すると、マッチの開始位置を pos から行
うよう制御できます(pos のデフォルト値は 0)。

//emlist[例][ruby]{
p(/(.).(.)/.match(...
..."foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}

pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}

//emlist[][ruby]{
re.match(str, pos)
//}
は異なり...
...チした場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。

//emlist[例][ruby]{
results = []
/((.)\2)/.match("foo") {|m| results << m[0]...

絞り込み条件を変える

<< 1 2 3 ... > >>