種類
- 文書 (5)
- インスタンスメソッド (1)
- クラス (1)
ライブラリ
- ビルトイン (2)
クラス
- Regexp (1)
キーワード
- Regexp (1)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (1)
- Ruby用語集 (1)
- encoding (1)
- オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (1)
- リテラル (1)
- 正規表現 (1)
検索結果
-
正規表現 (69001.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...= /\A
\d+ # 整数部
(\. # 小数点
\d+ # 小数部
)? # 小数点 + 小数部 はなくともよい
\z/x
float_pat.match("3.14") # => #<MatchData "3.14" 1:".14">
//}
空白を表現したい場合はエスケープをしてください。
//emlist[][ruby]{
/x y/x.match("x y") # => ni... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (37.0)
-
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or plus minus ast slash hat sq period comma langl rangl eq tilde dollar at under lbrarbra lbra2rbra2 lbra3rbra3 dq colon ac backslash semicolon
Rubyで使われる記号の意味(正規表現の複雑な記号は除く)
ex q num per and or
plus minus ast slash hat sq
period comma langl rangl eq tilde
dollar at under lbrarbra
lbra2rbra2 lbra3rbra3 dq colon ac
backslash semicolon
===[a:ex] !
: !true
not 演算子。d:spec/operator#notを参照。
: 3 != 5
「等しくない」比較演算子。d:spec/operator#notを参... -
Ruby用語集 (37.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...メソッドの
いくつかは未定義にされている。
: リテラル
: literal
プログラム中に直接記述された値のこと。3.14 や "foo" や /\d+/ はリテラル
だが、1 + 2 はリテラルではない。
Math::PI も定数参照なのでリテラルではない。... -
Regexp (19.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"
//}
Ruby 3.0.0... -
Regexp
# encoding -> Encoding (19.0) -
正規表現オブジェクトのエンコーディングを表す Encoding オブジェクト を返します。
正規表現オブジェクトのエンコーディングを表す Encoding オブジェクト
を返します。
@see d:spec/regexp#encoding -
オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (19.0)
-
オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル * Ruby オフィシャルサイト https://www.ruby-lang.org/ja/ * version 3.1 対応リファレンス * 原著:まつもとゆきひろ * 最新版URL: https://www.ruby-lang.org/ja/documentation/
...ト指向スクリプト言語 Ruby リファレンスマニュアル
* Ruby オフィシャルサイト https://www.ruby-lang.org/ja/
* version 3.1 対応リファレンス
* 原著:まつもとゆきひろ
* 最新版URL: https://www.ruby-lang.org/ja/documentation/
=== 使用上の注意... -
リテラル (19.0)
-
リテラル * num * string * backslash * exp * char * command * here * regexp * array * hash * range * symbol * percent
...数
: 0377
: 0o377
8進整数
: 42r
: 3.14r
有理数。
ただし、誤解を招く恐れがあるため、6.022e+23r のような指数部に有理数リ
テラルを含む形式は指定できません。
: 42i
: 3.14i
複素数
: 42ri
: 3.14ri
虚数部が有理数の複素数...