別のキーワード
クラス
-
Encoding
:: Converter (3) - Regexp (4)
- Thread (2)
モジュール
- Process (1)
キーワード
- compile (1)
-
last
_ match (2) -
last
_ status (1) - new (4)
-
report
_ on _ exception (1) -
report
_ on _ exception= (1)
検索結果
先頭5件
-
Regexp
. last _ match(nth) -> String | nil (27688.0) -
整数 nth が 0 の場合、マッチした文字列を返します ($&)。それ以外では、nth 番目の括弧にマッチ した部分文字列を返します($1,$2,...)。 対応する括弧がない場合やマッチしなかった場合には nil を返し ます。
整数 nth が 0 の場合、マッチした文字列を返します
($&)。それ以外では、nth 番目の括弧にマッチ
した部分文字列を返します($1,$2,...)。
対応する括弧がない場合やマッチしなかった場合には nil を返し
ます。
//emlist[例][ruby]{
/(.)(.)/ =~ "ab"
p Regexp.last_match # => #<MatchData:0x4599e58>
p Regexp.last_match(0) # => "ab"
p Regexp.last_match(1) # => "a"
p Regexp.last_match(2) ... -
Process
. last _ status -> Process :: Status | nil (27649.0) -
カレントスレッドで最後に終了した子プロセスのステータスを返します。
カレントスレッドで最後に終了した子プロセスのステータスを返します。
変数 $? の値と同じです。
Process.wait Process.spawn("ruby", "-e", "exit 13")
Process.last_status # => #<Process::Status: pid 4825 exit 13>
カレントスレッドで子プロセスを実行したことがない場合は nil を返します。
Process.last_status # => nil
@see Process::Status
@see $? -
Regexp
. last _ match -> MatchData (27553.0) -
カレントスコープで最後に行った正規表現マッチの MatchData オ ブジェクトを返します。このメソッドの呼び出しは $~ の参照と同じです。
カレントスコープで最後に行った正規表現マッチの MatchData オ
ブジェクトを返します。このメソッドの呼び出しは $~
の参照と同じです。
//emlist[例][ruby]{
/(.)(.)/ =~ "ab"
p Regexp.last_match # => #<MatchData:0x4599e58>
p Regexp.last_match[0] # => "ab"
p Regexp.last_match[1] # => "a"
p Regexp.last_match[2] # => "b"
p Regexp.last_match[3] # => nil... -
Regexp
. compile(string , option = nil , code = nil) -> Regexp (18382.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えます。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, fals... -
Thread
. report _ on _ exception -> bool (18328.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro... -
Thread
. report _ on _ exception=(newstate) (18328.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro... -
Regexp
. new(string , option = nil , code = nil) -> Regexp (9382.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えます。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, fals... -
Encoding
:: Converter . new(convpath) -> Encoding :: Converter (418.0) -
Encoding::Converter オブジェクトを作成します。
Encoding::Converter オブジェクトを作成します。
@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列
options では String#encode でのハッシュオプションに加えて、以下の定数が利用可能です。
* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_RE... -
Encoding
:: Converter . new(source _ encoding , destination _ encoding , options) -> Encoding :: Converter (418.0) -
Encoding::Converter オブジェクトを作成します。
Encoding::Converter オブジェクトを作成します。
@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列
options では String#encode でのハッシュオプションに加えて、以下の定数が利用可能です。
* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_RE... -
Encoding
:: Converter . new(source _ encoding , destination _ encoding) -> Encoding :: Converter (118.0) -
Encoding::Converter オブジェクトを作成します。
Encoding::Converter オブジェクトを作成します。
@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列
options では String#encode でのハッシュオプションに加えて、以下の定数が利用可能です。
* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_RE...