るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

キーワード

検索結果

Regexp#encoding -> Encoding (27331.0)

正規表現オブジェクトのエンコーディングを表す Encoding オブジェクト を返します。

...正規表現オブジェクトのエンコーディングを表す Encoding オブジェクト
を返します。


@see d:spec/regexp#encoding...

Regexp#fixed_encoding? -> bool (15364.0)

正規表現が任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。

...# -*- coding:utf-8 -*-

r = /a/
r.fixed_encoding? # => false
r.encoding # => #<Encoding:US-ASCII>
r =~ "\u{6666} a" # => 2
r =~ "\xa1\xa2 a".force_encoding("euc-jp") # => 2
r =~ "abc".force_encoding...
...("euc-jp") # => 0

r = /a/u
r.fixed_encoding? # => true
r.encoding # => #<Encoding:UTF-8>
r =~ "\u{6666} a" # => 2
begin
r =~ "\xa1\xa2".force_encoding("euc-jp")
rescue => e
e.class...
...# => Encoding::CompatibilityError
end
r =~ "abc".force_encoding("euc-jp") # => 0

r = /\u{6666}/
r.fixed_encoding? # => true
r.encoding # => #<Encoding:UTF-8>
r =~ "\u{6666} a"...

Regexp::FIXEDENCODING -> Integer (15213.0)

正規表現が特定のエンコーディングの文字列にしかマッチしないことを意味します。

...正規表現が特定のエンコーディングの文字列にしかマッチしないことを意味します。

@see Regexp#fixed_encoding?...

Regexp::NOENCODING -> Integer (15201.0)

正規表現のマッチ時に文字列のエンコーディングを無視し、 バイト列としてマッチすることを意味します。

正規表現のマッチ時に文字列のエンコーディングを無視し、
バイト列としてマッチすることを意味します。

正規表現リテラルの n オプションに対応します。