1007件ヒット
[1-100件を表示]
(0.173秒)
モジュール
- Kernel (198)
キーワード
- !~ (11)
-
$ & (11) -
$ & # 39; (11) -
$ -F (11) -
$ 1 (11) -
$ 10 (11) -
$ 11 (11) -
$ 2 (11) -
$ 3 (11) -
$ 4 (11) -
$ 5 (11) -
$ 6 (11) -
$ 7 (11) -
$ 8 (11) -
$ 9 (11) -
$ ; (11) -
$ ` (11) -
$ ~ (11) - == (11)
- === (22)
- =~ (26)
- EXTENDED (11)
- FIXEDENCODING (11)
- IGNORECASE (11)
- MULTILINE (11)
- NOENCODING (11)
- Regexp (11)
- RegexpError (11)
- [] (99)
- []= (55)
- casefold? (11)
- compile (11)
- encoding (11)
- eql? (11)
- escape (11)
-
fixed
_ encoding? (11) - hash (11)
- inspect (11)
-
last
_ match (22) - match (44)
- match? (24)
-
named
_ captures (11) - names (22)
- new (11)
- print (11)
- quote (11)
- slice (121)
- slice! (66)
- source (11)
-
to
_ regexp (11) -
to
_ s (11) -
try
_ convert (11) - union (11)
- ~ (11)
検索結果
先頭5件
-
MatchData
# regexp -> Regexp (32410.0) -
自身の元になった正規表現オブジェクトを返します。
...自身の元になった正規表現オブジェクトを返します。
//emlist[例][ruby]{
m = /a.*b/.match("abc")
m.regexp # => /a.*b/
//}... -
Regexp
. compile(string , option = nil , code = nil) -> Regexp (23306.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...am option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指......am code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ以外の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[......This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
', Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_m... -
Regexp
. new(string , option = nil , code = nil) -> Regexp (23306.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...am option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指......am code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ以外の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[......This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"
t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
', Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_m... -
Regexp
. try _ convert(obj) -> Regexp | nil (23247.0) -
obj を to_regexp メソッドで Regexp オブジェクトに変換しようと 試みます。
...obj を to_regexp メソッドで Regexp オブジェクトに変換しようと
試みます。
変換に成功した場合はそれを返し、失敗時には nil を返します。
//emlist[例][ruby]{
Regexp.try_convert(/re/) # => /re/
Regexp.try_convert("re") # => nil
//}... -
Regexp
# encoding -> Encoding (23208.0) -
正規表現オブジェクトのエンコーディングを表す Encoding オブジェクト を返します。
...正規表現オブジェクトのエンコーディングを表す Encoding オブジェクト
を返します。
@see d:spec/regexp#encoding... -
Regexp
# fixed _ encoding? -> bool (23126.0) -
正規表現が任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。
...se を返します。
//emlist[例][ruby]{
# -*- 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("eu......ce_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.......# => 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" # => 0
begin... -
Regexp
# inspect -> String (23124.0) -
Regexp#to_s より自然な文字列を返します。
...Regexp#to_s より自然な文字列を返します。
//emlist[例][ruby]{
p /^ugou.*?/i.to_s # => "(?i-mx:^ugou.*?)"
p /^ugou.*?/i.inspect # => "/^ugou.*?/i"
//}
@see Regexp#to_s... -
Regexp
# casefold? -> bool (23120.0) -
正規表現が大文字小文字の判定をしないようにコンパイルされている時、 真を返します。
...正規表現が大文字小文字の判定をしないようにコンパイルされている時、
真を返します。
//emlist[例][ruby]{
reg = Regexp.new("foobar", Regexp::IGNORECASE)
p reg.casefold? # => true
reg = Regexp.new("hogehoge")
p reg.casefold? # => false
//}... -
Regexp
# eql?(other) -> bool (23114.0) -
otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。
...erが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。
@param other 正規表現を指定します。
//emlist[例][ruby]{
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
. escape(string) -> String (23108.0) -
string の中で正規表現において特別な意味を持つ文字の直前にエ スケープ文字(バックスラッシュ)を挿入した文字列を返します。
...持つ文字の直前にエ
スケープ文字(バックスラッシュ)を挿入した文字列を返します。
@param string 正規表現において特別な意味をもつ文字をもつ文字列を指定します。
//emlist[例][ruby]{
rp = Regexp.escape("$bc^")
p rp # => "\\$bc\\^"
//}...