別のキーワード
ライブラリ
- ビルトイン (1206)
- abbrev (12)
- json (228)
-
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 (108) - 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)
- 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) -
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= (12)
-
space
_ before (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 (30415.0) -
マッチ対象になった文字列の複製を返します。
...マッチ対象になった文字列の複製を返します。
返す文字列はフリーズ(Object#freeze)されています。
//emlist[例][ruby]{
m = /(.)(.)(\d+)(\d)/.match("THX1138.")
m.string # => "THX1138."
//}... -
String
# match(regexp , pos = 0) -> MatchData | nil (18419.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 (18414.0) -
ログに記録する時の日付のフォーマットです。
...e#strftime ではなく、単に Time#usec の
値を String#% でフォーマットしたものが入ります。
//emlist[例][ruby]{
require 'logger'
logger = Logger.new(STDOUT)
logger.datetime_format # => nil
logger.debug("test")
logger.datetime_format = '%Y/%m/%dT%H:%M:%S.%06d'
logger.dateti......me_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
# pre _ match -> String (18308.0) -
マッチした部分より前の文字列を返します($`と同じ)。
...マッチした部分より前の文字列を返します($`と同じ)。
//emlist[例][ruby]{
/(bar)(BAZ)?/ =~ "foobarbaz"
p $~.pre_match # => "foo"
//}
@see MatchData#post_match... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (18249.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...インデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表......現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開....../emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("... -
String
# rindex(pattern , pos = self . size) -> Integer | nil (18243.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...文字列のインデックス pos から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のインデックスを返します。
見つからなければ nil を返します。
引数 pattern は探索する部分文字列または正規表現で指......定します。
pos が負の場合は、文字列の末尾から数えた位置から探索します。
rindex と String#index とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開始位置を右か......。
//emlist[String#index の場合][ruby]{
p "stringstring".index("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#rindex の場合][ruby]{
p "stringstring".rindex("ing", -1)... -
String
# match?(regexp , pos = 0) -> bool (18237.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 (18219.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... -
REXML
:: Attribute # to _ string -> String (15433.0) -
"name='value'" という形式の文字列を返します。
..."name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}... -
String
# tr(pattern , replace) -> String (15338.0) -
pattern 文字列に含まれる文字を検索し、 それを replace 文字列の対応する文字に置き換えます。
...pattern 文字列に含まれる文字を検索し、
それを replace 文字列の対応する文字に置き換えます。
pattern の形式は tr(1) と同じです。つまり、
`a-c' は a から c を意味し、"^0-9" のように
文字列の先頭が `^' の場合は指定文字以外......が置換の対象になります。
replace に対しても `-' による範囲指定が可能です。
`-' は文字列の両端にない場合にだけ範囲指定の意味になります。
`^' も文字列の先頭にあるときにだけ否定の効果を発揮します。
また、`-', `^',......
replace の範囲が pattern の範囲よりも小さい場合は、
replace の最後の文字が無限に続くものとして扱われます。
@param pattern 置き換える文字のパターン
@param replace pattern で指定した文字を置き換える文字
//emlist[例][ruby]{
p...