るりまサーチ

最速Rubyリファレンスマニュアル検索!
770件ヒット [501-600件を表示] (0.163秒)
トップページ > クエリ:t[x] > クエリ:Ruby[x] > クエリ:ruby[x] > クエリ:string[x] > モジュール:Kernel[x] > クエリ:String[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < ... 4 5 6 7 8 > >>

Kernel$$4 -> String | nil (335.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...st_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print...
...$2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$5 -> String | nil (335.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...st_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print...
...$2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$6 -> String | nil (335.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...st_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print...
...$2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$7 -> String | nil (335.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...st_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print...
...$2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$8 -> String | nil (335.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...st_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print...
...$2
end
#=> "http://example.com"
#=> "example.com"
//}...

絞り込み条件を変える

Kernel$$9 -> String | nil (335.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...st_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルスコープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print...
...$2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$archdir -> String (335.0)

マシン固有のライブラリを置くディレクトリです。 通常は "/usr/local/lib/ruby/バージョン/arch" です。

...マシン固有のライブラリを置くディレクトリです。
通常は "/usr/local/lib/ruby/バージョン/arch" です。...

Kernel$$srcdir -> String (335.0)

Ruby インタプリタを make したときのソースディレクトリです。

...
Ruby
インタプリタを make したときのソースディレクトリです。...

Kernel.#sub(pattern) {|matched| ... } -> String (335.0)

$_.sub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。

...

@raise ArgumentError replace を指定しなかった場合に発生します。

$_.sub とこのメソッド sub は以下の点で違いがあります。

* sub は $_ の値をコピーして、コピーの方を更新し、
$_ に再代入します。

@param pattern 置き換え...
...現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列

//emlist[例][ruby]{
$_ # => "testtest\n"
sub(/es/, '!!') # => "t!!ttest\n"
//}

@see String#sub,$_...
<< < ... 4 5 6 7 8 > >>