33件ヒット
[1-33件を表示]
(0.133秒)
検索結果
-
Regexp
:: FIXEDENCODING -> Integer (21301.0) -
正規表現が特定のエンコーディングの文字列にしかマッチしないことを意味します。
...正規表現が特定のエンコーディングの文字列にしかマッチしないことを意味します。
@see Regexp#fixed_encoding?... -
正規表現 (3810.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular expression)は......ば
//emlist[][ruby]{
/[a-z]/
/\Axyz\Z/
//}
という正規表現において "[a-z]", "\A", "\Z"はメタ文字列です。
===[a:expansion] 式展開
正規表現内では、#{式} という形式で式を評価した文字列を埋め込むことが
できます。
//emlist[][ruby]{
place = "......とができます。Regexp.new に Regexp::FIXEDENCODING を
指定することで明示的に指定することが可能です。
//emlist[][ruby]{
# -*- coding:utf-8 -*-
/あいう/.fixed_encoding? # => true
/abc/.fixed_encoding? # => false
/abc/e.fixed_encoding? # => true
/abc/ =~ "あいう" #... -
Regexp
# options -> Integer (3216.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 | Rege......D).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::EXTENDED).o...