るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.015秒)
トップページ > バージョン:2.6.0[x] > クエリ:Regexp[x] > 種類:クラス[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

Regexp (114166.0)

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

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

//emlist[][ruby]{
/^this is regexp/
//}

Regexp.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/rege...

RegexpError (18040.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

MatchData (40.0)

正規表現のマッチに関する情報を扱うためのクラス。

正規表現のマッチに関する情報を扱うためのクラス。

このクラスのインスタンスは、
* Regexp.last_match
* Regexp#match, String#match
* $~
などにより得られます。