16件ヒット
[1-16件を表示]
(0.094秒)
検索結果
-
StringScanner
# [](nth) -> String | nil (42206.0) -
前回マッチした正規表現の nth 番目のかっこに対応する部分文字列を 返します。インデックス 0 はマッチした部分全体です。前回のマッチが 失敗していると常に nil を返します。
...チが
失敗していると常に nil を返します。
@param nth 前回マッチした正規表現の nth 番目のかっこに対応する部分文字列を
返します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.scan(/\w(\w)(\w*)/) # => "tes......# => nil
s[0] # => nil
s[1] # => nil
s[2] # => nil
s.scan(/\s+/) # => " "
s[0] # => " "
s[1] # => nil
s[2] # => nil
s.scan(/\w(\w)(\w*)/) # => "string"
s[0] # => "string"
s[......1] # => "t"
s[2] # => "ring"
//}... -
NEWS for Ruby 2
. 7 . 0 (18.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマッチが実験的機能として導入されました。 14912
//emlist[][ruby]{
case [0, [1, 2, 3]]
in [a, [b, *c]]
p a #=> 0......nd
//}
//emlist[][ruby]{
case {a: 0, b: 1}
in {a: 0, x: 1}
:unreachable
in {a: 0, b: var}
p var #=> 1
end
//}
//emlist[][ruby]{
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
//}
//emlist{
json = <<END
{
"name": "Alice",
"age": 30,
"children": [{ "n......た。
* https://github.com/rubygems/rubygems/releases/tag/v3.1.0
* https://github.com/rubygems/rubygems/releases/tag/v3.1.1
* https://github.com/rubygems/rubygems/releases/tag/v3.1.2
* StringScanner
* 1.0.3に更新されました。
https://github.com/ruby/strscan/bl...