ライブラリ
- ビルトイン (1206)
- abbrev (12)
- json (180)
-
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / rational (12) - logger (24)
- matrix (24)
-
net
/ http (12) - open-uri (12)
- optparse (36)
- pathname (48)
- rake (84)
-
rake
/ packagetask (12) -
rexml
/ document (144) -
ripper
/ lexer (16) -
rubygems
/ gem _ path _ searcher (12) -
rubygems
/ installer (12) -
rubygems
/ specification (24) - stringio (74)
- strscan (96)
- win32ole (12)
クラス
-
ARGF
. class (12) - Array (33)
- Binding (7)
- Class (12)
- Data (6)
- Date (12)
- DateTime (12)
- Dir (24)
- Enumerator (24)
- File (24)
-
File
:: Stat (24) - Float (24)
-
Gem
:: GemPathSearcher (12) -
Gem
:: Installer (12) -
Gem
:: Specification (24) - IO (6)
-
JSON
:: State (60) - Logger (24)
- MatchData (158)
- Matrix (24)
- Method (12)
- Module (216)
-
Net
:: HTTPGenericRequest (12) - Object (15)
- OptionParser (36)
- Pathname (48)
- Proc (12)
-
REXML
:: Attribute (36) -
REXML
:: Attributes (36) -
REXML
:: CData (24) -
REXML
:: DocType (12) -
REXML
:: Element (36) -
Rake
:: Application (36) -
Rake
:: FileList (36) -
Rake
:: InvocationChain (12) -
Rake
:: PackageTask (12) - Range (33)
- Rational (36)
-
Ripper
:: Lexer (16) -
RubyVM
:: InstructionSequence (34) - String (413)
- StringIO (74)
- StringScanner (96)
- Symbol (9)
-
Thread
:: Backtrace :: Location (72) - Time (12)
- TracePoint (12)
- UnboundMethod (12)
-
WIN32OLE
_ TYPELIB (12)
モジュール
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) -
OpenURI
:: Meta (12)
キーワード
- % (14)
- [] (60)
- abbrev (12)
-
absolute
_ path (24) -
add
_ element (12) -
array
_ nl (12) - attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) -
attribute
_ of (12) - autoload (12)
-
base
_ label (12) - binread (12)
- byteindex (3)
- byterindex (3)
- bytes (7)
- captures (12)
- concat (33)
-
const
_ source _ location (12) -
datetime
_ format (12) - deconstruct (2)
-
deprecate
_ constant (12) - dev (12)
- each (12)
-
each
_ byte (24) -
each
_ char (12) -
each
_ codepoint (12) -
each
_ grapheme _ cluster (8) -
each
_ line (24) -
formatted
_ program _ filename (12) - formatter (12)
- ftype (12)
- gsub (48)
- gsub! (60)
- indent (12)
- index (12)
- inspect (63)
-
json
_ creatable? (12) - label (12)
- lex (8)
-
lib
_ dirs _ for (12) - lines (7)
- match (24)
- match? (30)
- matched (12)
- matched? (12)
-
matched
_ size (12) - name (12)
- names (12)
- namespace (12)
- namespaces (12)
-
object
_ nl (12) - on (36)
-
original
_ dir (12) - pack (21)
-
package
_ dir _ path (12) - parse (8)
- path (99)
- pathmap (12)
-
post
_ match (24) -
pre
_ match (24) - prefix (12)
- prefixes (12)
- printf (12)
- private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) - rakefile (12)
-
remove
_ const (12) - rindex (12)
-
rubygems
_ version (12) - scan (24)
-
source
_ location (43) - space (12)
-
space
_ before (12) - status (12)
- step (19)
- strftime (12)
- sub (60)
- sub! (48)
- terminate (12)
- text (12)
- then (7)
-
to
_ a (12) -
to
_ binary (10) -
to
_ f (12) -
to
_ json (144) -
to
_ path (27) -
to
_ r (12) -
to
_ ruby (12) -
to
_ s (99) -
to
_ string (12) - tr (12)
-
tr
_ s (12) -
tr
_ s! (12) - truncate (12)
- unpack (12)
- unpack1 (9)
- value (12)
-
values
_ at (12) -
with
_ object (24) - xpath (12)
-
yield
_ self (8)
検索結果
先頭5件
-
MatchData
# string -> String (24315.0) -
マッチ対象になった文字列の複製を返します。
...マッチ対象になった文字列の複製を返します。
返す文字列はフリーズ(Object#freeze)されています。
//emlist[例][ruby]{
m = /(.)(.)(\d+)(\d)/.match("THX1138.")
m.string # => "THX1138."
//}... -
String
# match(regexp , pos = 0) -> MatchData | nil (15419.0) -
regexp.match(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match を参照してください。
...regexp.match(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match を参照してください。
//emlist[例: regexp のみの場合][ruby]{
'hello'.match('(.)\1') # => #<MatchData "ll" 1:"l">
'hello'.match('(.)\......[0] # => "ll"
'hello'.match(/(.)\1/)[0] # => "ll"
'hello'.match('xx') # => nil
//}
//emlist[例: regexp, pos を指定した場合][ruby]{
'hoge hige hege bar'.match('h.ge', 0) # => #<MatchData "hoge">
'hoge hige hege bar'.match('h.ge', 1) # => #<MatchData "hige">
//}
//emlist[......例: ブロックを指定した場合][ruby]{
'hello'.match('(.)\1'){|e|"match #{$1}"} # => "match l"
'hello'.match('xx'){|e|"match #{$1}"} # マッチしないためブロックは実行されない
//}
@see Regexp#match, Symbol#match... -
String
# match?(regexp , pos = 0) -> bool (15225.0) -
regexp.match?(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match? を参照してください。
...regexp.match?(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match? を参照してください。
//emlist[例][ruby]{
"Ruby".match?(/R.../) #=> true
"Ruby".match?(/R.../, 1) #=> false
"Ruby".match?(/P.../) #=>......false
$& #=> nil
//}
@see Regexp#match?, Symbol#match?... -
String
# match(regexp , pos = 0) {|m| . . . } -> object (15219.0) -
regexp.match(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match を参照してください。
...regexp.match(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match を参照してください。
//emlist[例: regexp のみの場合][ruby]{
'hello'.match('(.)\1') # => #<MatchData "ll" 1:"l">
'hello'.match('(.)\......[0] # => "ll"
'hello'.match(/(.)\1/)[0] # => "ll"
'hello'.match('xx') # => nil
//}
//emlist[例: regexp, pos を指定した場合][ruby]{
'hoge hige hege bar'.match('h.ge', 0) # => #<MatchData "hoge">
'hoge hige hege bar'.match('h.ge', 1) # => #<MatchData "hige">
//}
//emlist[......例: ブロックを指定した場合][ruby]{
'hello'.match('(.)\1'){|e|"match #{$1}"} # => "match l"
'hello'.match('xx'){|e|"match #{$1}"} # マッチしないためブロックは実行されない
//}
@see Regexp#match, Symbol#match... -
Logger
# datetime _ format -> String | nil (12426.0) -
ログに記録する時の日付のフォーマットです。
...して
"%Y-%m-%dT%H:%M:%S.%06d " を使用します。
なお、"%06d" には Time#strftime ではなく、単に Time#usec の
値を String#% でフォーマットしたものが入ります。
//emlist[例][ruby]{
require 'logger'
logger = Logger.new(STDOUT)
logger.datetime_format # => nil
lo......st")
logger.datetime_format = '%Y/%m/%dT%H:%M:%S.%06d'
logger.datetime_format # => "%Y/%m/%dT%H:%M:%S.%06d"
logger.debug("test")
# => D, [2019-03-12T22:52:13.674385 #17393] DEBUG -- : test
# D, [2019/03/12T22:52:13.000012#17393] DEBUG -- : test
//}
@see Time#strftime, Logger#datetime_format=... -
MatchData
# values _ at(*index) -> [String] (12363.0) -
正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。
...mlist[例][ruby]{
m = /(foo)(bar)(baz)/.match("foobarbaz")
# same as m.to_a.values_at(...)
p m.values_at(0, 1, 2, 3, 4) # => ["foobarbaz", "foo", "bar", "baz", nil]
p m.values_at(-1, -2, -3, -4, -5) # => ["baz", "bar", "foo", nil, nil]
m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")......m.to_a # => ["1 + 2", "1", "+", "2"]
m.values_at(:a, :b, :op) # => ["1", "2", "+"]
//}
@see Array#values_at, Array#[]... -
MatchData
# post _ match -> String (12308.0) -
マッチした部分より後ろの文字列を返します($'と同じ)。
...マッチした部分より後ろの文字列を返します($'と同じ)。
//emlist[例][ruby]{
/(bar)(BAZ)?/ =~ "foobarbaz"
p $~.post_match # => "baz"
//}
@see MatchData#pre_match... -
MatchData
# pre _ match -> String (12308.0) -
マッチした部分より前の文字列を返します($`と同じ)。
...マッチした部分より前の文字列を返します($`と同じ)。
//emlist[例][ruby]{
/(bar)(BAZ)?/ =~ "foobarbaz"
p $~.pre_match # => "foo"
//}
@see MatchData#post_match... -
String
# concat(*arguments) -> self (12215.0) -
self に複数の文字列を破壊的に連結します。
...ます。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # => "foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}
@see String#append_as_bytes... -
String
# concat(other) -> self (12215.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...追加します。
self を返します。
@param other 文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "stringXXX"
str << "YYY"
p str # => "stringXXXYYY"
str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}...