るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.009秒)
トップページ > クラス:Regexp[x] > クエリ:==[x]

関連するキーワード

  1. _builtin
  2. _builtin
  3. rexml
  4. openssl
  5. matrix

ライブラリ

キーワード

検索結果

Regexp#==(other) -> bool (18125)

otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。

...規表現であったらtrueを返します。

@param other 正規表現を指定します。

p /^eee$/ == /~eee$/x #=> false
p /^eee$/ == /~eee$/i #=> false
p /^eee$/e == /~eee$/u #=> false
p /^eee$/ == Regexp.new("^eee$") #=> true
p /^eee$/.eql?(/^eee$/) #=> true...

Regexp#===(string) -> bool (12201)

文字列 string との正規表現マッチを行います。マッチした場合、 マッチした位置のインデックスを返します(先頭は0)。マッチしなかった 場合、あるいは string が nil の場合には nil を返 します。

..."bar" #=> nil

組み込み変数 $~ もしくは Regexp.last_match にマッチに関する情報 MatchData が設定されます。

string がnil でも String オブジェクトでもなけれ
ば例外 TypeError が発生します。

Regexp
#=== は、真偽値を返します。引数が文...
...場合発生します。

p /foo/ =~ "foo" #=> 0
p Regexp.last_match(0) #=> "foo"
p /foo/ =~ "afoo" #=> 1
p $~[0] #=> "foo"
p /foo/ =~ "bar" #=> nil

unless /foo/ === "bar"
puts "not match " #=> not match
end

str = []
begin...

Regexp#=~(string) -> Fixnum | nil (6001)

文字列 string との正規表現マッチを行います。マッチした場合、 マッチした位置のインデックスを返します(先頭は0)。マッチしなかった 場合、あるいは string が nil の場合には nil を返 します。

..."bar" #=> nil

組み込み変数 $~ もしくは Regexp.last_match にマッチに関する情報 MatchData が設定されます。

string がnil でも String オブジェクトでもなけれ
ば例外 TypeError が発生します。

Regexp
#=== は、真偽値を返します。引数が文...
...場合発生します。

p /foo/ =~ "foo" #=> 0
p Regexp.last_match(0) #=> "foo"
p /foo/ =~ "afoo" #=> 1
p $~[0] #=> "foo"
p /foo/ =~ "bar" #=> nil

unless /foo/ === "bar"
puts "not match " #=> not match
end

str = []
begin...

Regexp#eql?(other) -> bool (3025)

otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。

...規表現であったらtrueを返します。

@param other 正規表現を指定します。

p /^eee$/ == /~eee$/x #=> false
p /^eee$/ == /~eee$/i #=> false
p /^eee$/e == /~eee$/u #=> false
p /^eee$/ == Regexp.new("^eee$") #=> true
p /^eee$/.eql?(/^eee$/) #=> true...