るりまサーチ

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

別のキーワード

  1. uri regexp
  2. _builtin regexp
  3. regexp match
  4. regexp last_match
  5. etc sc_regexp

ライブラリ

検索結果

Regexp#options -> Integer (27356.0)

正規表現の生成時に指定されたオプションを返します。戻り値は、 Regexp::EXTENDED, Regexp::IGNORECASE, Regexp::MULTILINE, Regexp::FIXEDENCODING, Regexp::NOENCODING, の論理和です。

...正規表現の生成時に指定されたオプションを返します。戻り値は、
Regexp
::EXTENDED, Regexp::IGNORECASE,
Regexp
::MULTILINE,
Regexp
::FIXEDENCODING,
Regexp
::NOENCODING,
の論理和です。

これで得られるオプションには生成時に指定したもの以外の
...
...Regexp.new にこれらを
渡しても無視されます。

//emlist[例][ruby]{
p Regexp::IGNORECASE # => 1
p //i.options # => 1

p Regexp.new("foo", Regexp::IGNORECASE ).options # => 1
p Regexp.new("foo", Regexp::EXTENDED).options # => 2
p Regexp.new("foo", Regexp::IGNORECASE | Regexp:...
...TENDED).options # => 3
p Regexp.new("foo", Regexp::MULTILINE).options # => 4
p Regexp.new("foo", Regexp::IGNORECASE | Regexp::MULTILINE ).options # => 5
p Regexp.new("foo", Regexp::MULTILINE | Regexp::EXTENDED).options # =>6
p Regexp.new("foo", Regexp::IGNORECASE | Regexp::MULTILINE | Regexp::EXTEND...