ライブラリ
- English (60)
- ビルトイン (799)
- csv (24)
-
irb
/ cmd / help (12) - matrix (12)
-
minitest
/ spec (1) -
minitest
/ unit (1) -
net
/ telnet (8) - openssl (36)
- optparse (24)
- pathname (36)
- rake (12)
-
rdoc
/ context (24) -
rdoc
/ parser (12) -
rexml
/ document (36) -
rinda
/ rinda (24) -
ripper
/ lexer (12) -
rubygems
/ gem _ path _ searcher (24) -
rubygems
/ platform (12) -
rubygems
/ spec _ fetcher (24) - scanf (48)
- strscan (144)
クラス
- CSV (24)
- File (24)
-
Gem
:: GemPathSearcher (24) -
Gem
:: Platform (12) -
Gem
:: SpecFetcher (24) -
IRB
:: ExtendCommand :: Help (12) - MatchData (298)
-
Net
:: Telnet (8) - Object (13)
- OptionParser (24)
- Pathname (36)
-
RDoc
:: Context (24) -
RDoc
:: Parser (12) -
REXML
:: Elements (12) -
REXML
:: Entity (12) -
REXML
:: XPath (12) - Regexp (105)
-
Rinda
:: DRbObjectTemplate (12) - Ripper (12)
-
Scanf
:: FormatSpecifier (24) -
Scanf
:: FormatString (24) - String (81)
- StringScanner (144)
- Symbol (21)
モジュール
-
File
:: Constants (12) - Kernel (264)
-
MiniTest
:: Assertions (1) -
OpenSSL
:: X509 (36) -
Rake
:: TaskManager (12)
キーワード
-
$ & (12) -
$ & # 39; (12) -
$ 1 (12) -
$ 10 (12) -
$ 11 (12) -
$ 2 (12) -
$ 3 (12) -
$ 4 (12) -
$ 5 (12) -
$ 6 (12) -
$ 7 (12) -
$ 8 (12) -
$ 9 (12) -
$ LAST _ MATCH _ INFO (12) -
$ LAST _ PAREN _ MATCH (12) -
$ MATCH (12) -
$ POSTMATCH (12) -
$ PREMATCH (12) -
$ ` (12) -
$ ~ (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - == (12)
- =~ (12)
- DateMatcher (12)
- DateTimeMatcher (12)
- EPROGMISMATCH (12)
- ERPCMISMATCH (12)
- ErrDimensionMismatch (12)
-
FNM
_ DOTMATCH (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - NoMatchingPatternError (6)
- Regexp (12)
-
SCRIPT
_ LINES _ _ (12) - Template (12)
-
V
_ ERR _ AKID _ ISSUER _ SERIAL _ MISMATCH (12) -
V
_ ERR _ AKID _ SKID _ MISMATCH (12) -
V
_ ERR _ SUBJECT _ ISSUER _ MISMATCH (12) - [] (48)
- accept (24)
-
assert
_ match (1) - begin (12)
- byteoffset (6)
- captures (12)
-
check
_ until (12) - cmd (4)
- compile (12)
- deconstruct (2)
-
deconstruct
_ keys (2) - end (12)
-
enhance
_ with _ matching _ rule (12) - eql? (12)
- execute (12)
- fetch (12)
-
find
_ matching (12) - fnmatch (24)
- fnmatch? (24)
- gsub (24)
- gsub! (12)
- hash (12)
- inspect (12)
- irb (12)
-
last
_ match (24) -
last
_ match _ tried (6) - length (12)
- match? (39)
-
match
_ fds (12) - matched (18)
- matched? (12)
-
matched
_ count (6) -
matched
_ size (12) -
matched
_ string (6) - matchedsize (12)
- matches? (12)
-
matching
_ file? (12) -
matching
_ files (12) -
mid
_ match? (6) -
must
_ match (1) -
named
_ captures (12) - names (12)
- new (24)
- offset (24)
-
parse
_ files _ matching (12) -
post
_ match (24) -
pre
_ match (24) - prune (6)
- regexp (12)
-
rexml
/ document (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
rubygems
/ commands / install _ command (12) -
rubygems
/ commands / pristine _ command (12) -
scan
_ full (12) -
scan
_ until (12) - size (12)
-
skip
_ until (12) - string (12)
- sub (36)
- sub! (12)
-
to
_ a (24) -
to
_ s (12) -
token
_ match (12) -
unmatched
_ alias _ lists (12) -
unmatched
_ alias _ lists= (12) - unscan (12)
-
values
_ at (12) - waitfor (4)
-
whole
_ match _ p (12) - ~ (12)
- クラス/メソッドの定義 (12)
- パターンマッチ (12)
- 正規表現 (12)
検索結果
先頭5件
-
rubygems
/ commands / install _ command (26012.0) -
Gem パッケージをローカルリポジトリにインストールするためのライブラリです。
...atform PLATFORM 指定されたプラットフォームの Gem パッケージをインストールします
-v, --version VERSION 指定されたバージョンの Gem パッケージをインストールします
Install/Update Options:
-i, --install-dir DIR......-n, --bindir DIR Gem パッケージに含まれるバイナリファイルの配置先を指定します
-d, --[no-]rdoc インストール時に RDoc を生成します
--[no-]ri インストール時に RI ドキュメン......--ignore-dependencies 依存している Gem パッケージをインストールしません
-y, --include-dependencies 依存している Gem パッケージをインストールします
--[no-]format-executable Make installed executable names match ruby.... -
rexml
/ document (26006.0) -
DOM スタイルの XML パーサ。
...
REXML::Document.new で XML 文書から DOM ツリーを
構築し、ツリーのノードの各メソッドで文書の内容にアクセスします。
以下のプログラムではブックマークの XML からデータを取り出します。
//emlist[][ruby]{
require 'rexml/document'
re......quire 'pp'
Bookmark = Struct.new(:href, :title, :desc)
doc = REXML::Document.new(<<XML)
<?xml version="1.0" encoding="UTF-8" ?>
<xbel version="1.0">
<bookmark href="http://www.ruby-lang.org/ja/">
<title>オブジェクト指向スクリプト言語 Ruby</title>
<desc>Rubyの公式サイ......mark>
<bookmark href="https://github.com/rurema/bitclust">
<title>rurema/bitclust · GitHub</title>
</bookmark>
<bookmark href="https://rubygems.org/gems/bitclust-core" />
</xbel>
XML
bookmarks = REXML::XPath.match(doc, "/xbel/bookmark").map do |bookmark|
href = bookmark.attribute("href... -
rubygems
/ commands / pristine _ command (26006.0) -
インストールされている Gem パッケージを初期状態にするためのライブラリです。
...ブラリです。
Usage: gem pristine [args] [options]
Options:
--all インストールされている全ての Gem パッケージを
初期状態に戻します
-v, --version VERSION 指定したバ......を表示します
-V, --[no-]verbose 表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE 指定された設定ファイルを使用します
--backtrace バックトレー......re to pristine condition (unless --all)
Summary:
Restores installed gems to pristine condition from files located in the gem
cache
Description:
The pristine command compares the installed gems with the contents of the
cached gem and restores any files that don't match... -
Regexp
# match(str , pos = 0) -> MatchData | nil (21416.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ
チングを行います。マッチした場合には結果を MatchData オブジェクトで返し
ます。
マッチしなかった場合 nil を返します。
省略可能な第二引数 pos......[ruby]{
p(/(.).(.)/.match("foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][ruby]{
re.match(......str, pos)
//}
は異なります。
ブロックを渡すと、マッチした場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。
//emli... -
String
# match(regexp , pos = 0) -> MatchData | nil (21412.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">
//}
//emlis......t[例: ブロックを指定した場合][ruby]{
'hello'.match('(.)\1'){|e|"match #{$1}"} # => "match l"
'hello'.match('xx'){|e|"match #{$1}"} # マッチしないためブロックは実行されない
//}
@see Regexp#match, Symbol#match... -
Regexp
# match(str , pos = 0) -> MatchData | nil (21410.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ
チングを行います。マッチした場合には結果を MatchData オブジェクトで返し
ます。
マッチしなかった場合 nil を返します。
省略可能な第二引数 pos......[ruby]{
p(/(.).(.)/.match("foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][ruby]{
re.match(......str, pos)
//}
は異なります。
ブロックを渡すと、マッチした場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。
//emli... -
Regexp
# match(str , pos = 0) {|m| . . . } -> object | nil (21316.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ
チングを行います。マッチした場合には結果を MatchData オブジェクトで返し
ます。
マッチしなかった場合 nil を返します。
省略可能な第二引数 pos......[ruby]{
p(/(.).(.)/.match("foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][ruby]{
re.match(......str, pos)
//}
は異なります。
ブロックを渡すと、マッチした場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。
//emli... -
String
# match(regexp , pos = 0) {|m| . . . } -> object (21312.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">
//}
//emlis......t[例: ブロックを指定した場合][ruby]{
'hello'.match('(.)\1'){|e|"match #{$1}"} # => "match l"
'hello'.match('xx'){|e|"match #{$1}"} # マッチしないためブロックは実行されない
//}
@see Regexp#match, Symbol#match... -
Regexp
# match(str , pos = 0) {|m| . . . } -> object | nil (21310.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ
チングを行います。マッチした場合には結果を MatchData オブジェクトで返し
ます。
マッチしなかった場合 nil を返します。
省略可能な第二引数 pos......[ruby]{
p(/(.).(.)/.match("foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][ruby]{
re.match(......str, pos)
//}
は異なります。
ブロックを渡すと、マッチした場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。
//emli... -
REXML
:: XPath . match(element , path = nil , namespaces = {} , variables = {}) -> [Node] (21207.0) -
element の path で指定した XPath 文字列にマッチするノードの配列を 返します。
...variable で XPath 内の変数に対応する値を指定できます。
XPathインジェクション攻撃を避けるため、適切な
エスケープを付加するため、に用います。
@param element 要素(REXML::Element)
@param path XPath文字列
@param namespace 名前空間とURL......対応付け
@param variables 変数名とその値の対応付け
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:x='1'>
<a>
<b>b1</b>
<x:c />
<b>b2</b>
<d />
</a>
<b> b3 </b>
</root>
EOS
REXML::XPath.match(doc, "/root/a/b") # => [<b>... -
Gem
:: Platform . match(platform) -> bool (21201.0) -
@todo ???
@todo ???