るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

Regexp#encoding -> Encoding (27231.0)

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

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


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

Regexp#fixed_encoding? -> bool (15204.0)

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

...*-

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")...
..._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:...
..."abc".force_encoding("euc-jp") # => 0

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

Regexp::FIXEDENCODING -> Integer (15113.0)

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

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

@see Regexp#fixed_encoding?...

Regexp::NOENCODING -> Integer (15101.0)

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

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

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