種類
- 文書 (33)
- インスタンスメソッド (22)
- 特異メソッド (22)
ライブラリ
- ビルトイン (44)
クラス
- Regexp (33)
-
RubyVM
:: InstructionSequence (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
first
_ lineno (11) - new (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) - ~ (11)
検索結果
先頭5件
-
Regexp
. compile(string , option = nil , code = nil) -> Regexp (18125.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...す。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORE......に失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
',......Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"
str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2 = Regexp.compile("ふる.*?と", Regexp::MULTILINE)
p t2.match(str)[0] # => "ふるいけや\nかわずと"
//}... -
Regexp
. new(string , option = nil , code = nil) -> Regexp (3025.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...す。
@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORE......に失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
',......Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"
str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2 = Regexp.compile("ふる.*?と", Regexp::MULTILINE)
p t2.match(str)[0] # => "ふるいけや\nかわずと"
//}... -
Regexp
# ~ -> Integer | nil (107.0) -
変数 $_ の値との間でのマッチをとります。
...f /foo/
puts "match"
else
puts "no match"
end
# => no match
# ただし、警告がでる。warning: regex literal in condition
reg = Regexp.compile("foo")
if ~ reg
puts "match"
else
puts "no match"
end
# => no match
if reg
puts "match"
else
puts "no match"
end
# => match
# reg... -
RubyVM
:: InstructionSequence # first _ lineno -> Integer (107.0) -
self が表す命令シーケンスの 1 行目の行番号を返します。
...self が表す命令シーケンスの 1 行目の行番号を返します。
例1:irb で実行した場合
RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1
例2:
# /tmp/method.rb
require "foo-library"
def foo
p :foo
end
RubyVM::InstructionSequence.of(m... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (48.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...リテラルの prefix として 0d が追加されました。
8進リテラルの prefix として 0 以外に 0o が追加されました。
Integer(), String#to_i、String#oct もこの prefix を認識します。
: ((<メソッド引数の & 修飾|メソッド呼び出し/イテレー......ストでブロックを実行するように
なりました。
=== Numeric
: ((<Numeric#step|Numeric/step>)) [compat]
((<Fixnum>)), ((<Integer>)) から移動しました。
=== Object
: ((<Object#singleton_methods|Object/singleton_methods>)) [compat]
省略可能な引数 all......ンパイルせず文字列そのものをパターンとして扱うようになりました。(よ
り正確には、Regexp.compile(arg) でなく
Regexp.compile(Regexp.quote(arg)) するようになりました)
((<String#~|String/~>)), ((<String#=~|String/=~>)) は、obsolete にな... -
ruby 1
. 6 feature (30.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...from -:2
ruby 1.6.7 (2002-07-30) [i586-linux]
: 2002-06-03 sprintf()
"%d" で引数を整数にするときに、((<組み込み関数/Integer>)) と同じ規則を
使用するようになりました。
p sprintf("%d", nil)
=> -:1:in `sprintf': no implicit conversio......:in `remove_instance_variable': instance variable @foo not defined (NameError)
ruby 1.6.7 (2002-04-10) [i586-linux]
: 2002-04-04: Integer#((<Integer/step>))
第二引数が 1 よりも小さい場合に 0 を指定したと見なされエラーになって
いました。
1.ste......#{..} の中などで不完全な部分がありました。
((<ruby-list:34478>))
#! ruby -Ks
p a = "#{"表"}"
=> -:1: compile error in string expansion (SyntaxError)
-:1: unterminated string meets end of file
ruby 1.6.7 (2002-03-15) [i586-linux]... -
ruby 1
. 8 . 4 feature (30.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...odError)
from -:7
: 正規表現 [bug]
#Wed Oct 19 01:27:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * regex.c (re_compile_pattern): numeric literal inside character class
# disabled succeeding backtrack. fixed: [ruby-list:41328]
文字コードの形で......:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * sprintf.c (rb_str_format): integer overflow check added.
#
# * sprintf.c (GETASTER): ditto.
printfのフォーマット指定子にinteger overflowのバグがありました。
perl のそれとは違い、セキュリテ......values have VALUE type. there is an environment where sizeof(VALUE)
# != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
# and received by 64bit integer (VALUE), upper bits may have garbage value.
# [ruby-dev:27513]
IA64 で、Qtrue Qfalse Qnil が 6...