るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.032秒)
トップページ > クエリ:spec/regexp[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. format spec
  2. format spec=
  3. oldformat spec
  4. installer spec
  5. oldformat spec=

クラス

キーワード

検索結果

Regexp (8.0)

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

...現オブジェクトを動的に生成する
こともできます。

//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 も参照してください。...
..."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 も参照してください。...

Regexp#encoding -> Encoding (8.0)

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

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


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