るりまサーチ

最速Rubyリファレンスマニュアル検索!
1044件ヒット [101-200件を表示] (0.016秒)

別のキーワード

  1. resolv regex
  2. ipv6 regex
  3. ipv4 regex
  4. ipv6 regex_8hex
  5. ipv6 regex_6hex4dec

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Object#to_regexp -> Regexp (6200.0)

オブジェクトの Regexp への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。

...オブジェクトの Regexp への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。

説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
...
...ての場面で代置可能であるような、
* 正規表現そのものとみなせるようなもの
という厳しいものになっています。

//emlist[][ruby]{
class Foo
def to_regexp
/[\d]+/
end
end

it = Foo.new
p Regexp.union(/^at/, it) #=> /(?-mix:^at)|(?-mix:[\d]+)/
//}...

Resolv::AddressRegex -> Regexp (6200.0)

IPアドレスにマッチする正規表現です。

IPアドレスにマッチする正規表現です。

URI.regexp -> Regexp (6200.0)

URIにマッチする正規表現を返します。

...どうかは必要に応じて別途
検査してください。

このメソッドは Ruby 2.2 から obsolete です。

@param schemes マッチさせたいスキームを、文字列の配列として与えます。

例:
require 'uri'
p URI.regexp =~ "http://www.ruby-lang.org/" #=> 0...

URI.regexp(schemes) -> Regexp (6200.0)

URIにマッチする正規表現を返します。

...どうかは必要に応じて別途
検査してください。

このメソッドは Ruby 2.2 から obsolete です。

@param schemes マッチさせたいスキームを、文字列の配列として与えます。

例:
require 'uri'
p URI.regexp =~ "http://www.ruby-lang.org/" #=> 0...

struct RRegexp * RREGEXP(VALUE obj) (6200.0)

絞り込み条件を変える

Regexp (6000.0)

正規表現のクラス。正規表現のリテラルはスラッシュで囲んだ形式 で記述します。

...is regexp/
//}

Regex
p.new(string) を使って正規表現オブジェクトを動的に生成する
こともできます。

//emlist[][ruby]{
str = "this is regexp"
rp1 = Regexp.new("^this is regexp")
p rp1 =~ str # => 0
p Regexp.last_match[0] # => "this is regexp"
//}


spec/regexp...
...や d:spec/literal#regexp も参照してください。...
...y]{
/^this is regexp/
//}

Regex
p.new(string) を使って正規表現オブジェクトを動的に生成する
こともできます。

//emlist[][ruby]{
str = "this is regexp"
rp1 = Regexp.new("^this is regexp")
p rp1 =~ str # => 0
p Regexp.last_match[0] # => "this is regexp"
//}

Ruby...
...3.0.0 から正規表現リテラルは freeze されるようになりました。
//emlist[][ruby]{
p /abc/.frozen?
# => true
p /a#{42}bc/.frozen?
# => true
p Regexp.new('abc').frozen?
# => false
//}

spec/regexp や d:spec/literal#regexp も参照してください。...

RegexpError (6000.0)

正規表現のコンパイルに失敗したときに発生します。

...正規表現のコンパイルに失敗したときに発生します。

例:

$ ruby -e 'Regexp.compile("*")'
-e:1:in `initialize': target of repeat operator is not specified: /*/ (RegexpError)
from -e:1:in `Regexp#compile'
from -e:1...

json/add/regexp (6000.0)

Regexp に JSON 形式の文字列に変換するメソッドや JSON 形式の文字列から Ruby のオブジェクトに変換するメソッドを定義します。

...Regexp に JSON 形式の文字列に変換するメソッドや JSON 形式の文字列から Ruby のオブジェクトに変換するメソッドを定義します。...

Etc::SC_REGEXP -> Integer (3100.0)

Etc.#sysconf の引数に指定します。

Etc.#sysconf の引数に指定します。

詳細は sysconf(3) を参照してください。

Regexp.compile(string, option = nil) -> Regexp (3100.0)

文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

...@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regex
p::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regex
p::IGNORECASE...
...じになります。

@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。

//emlist[例][ruby]{
str = "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_match # => "This is Regexp"

str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2 = Regexp.compile("ふる.*?と", Regexp::MULTILINE)
p t2.match(str)...

絞り込み条件を変える

Regexp.compile(string, option = nil, code = nil) -> Regexp (3100.0)

文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

...@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regex
p::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regex
p::IGNORECASE...
...を出力します。

@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。

//emlist[例][ruby]{
str = "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_match # => "This is Regexp"

str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2 = Regexp.compile("ふる.*?と", Regexp::MULTILINE)
p t2.match(str)...
<< < 1 2 3 4 ... > >>