904件ヒット
[201-300件を表示]
(0.066秒)
ライブラリ
- English (44)
- ビルトイン (489)
- csv (11)
-
irb
/ cmd / help (11) -
net
/ telnet (8) - pathname (11)
-
rdoc
/ context (11) -
rexml
/ document (11) -
rinda
/ rinda (11) -
rubygems
/ gem _ path _ searcher (11) - scanf (30)
- strscan (154)
クラス
-
Gem
:: GemPathSearcher (11) -
IRB
:: ExtendCommand :: Help (11) - MatchData (143)
-
Net
:: Telnet (8) - Pathname (11)
-
RDoc
:: Context (11) -
REXML
:: Entity (11) - Regexp (55)
-
Scanf
:: FormatSpecifier (6) -
Scanf
:: FormatString (24) - String (74)
- StringScanner (154)
- Symbol (19)
モジュール
- Kernel (220)
キーワード
-
$ & (11) -
$ & # 39; (11) -
$ 1 (11) -
$ 10 (11) -
$ 11 (11) -
$ 2 (11) -
$ 3 (11) -
$ 4 (11) -
$ 5 (11) -
$ 6 (11) -
$ 7 (11) -
$ 8 (11) -
$ 9 (11) -
$ LAST _ PAREN _ MATCH (11) -
$ MATCH (11) -
$ POSTMATCH (11) -
$ PREMATCH (11) -
$ ` (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (11)
- =~ (11)
- CSV (11)
- MatchData (11)
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Regexp (11)
- Template (11)
- [] (44)
- captures (11)
-
check
_ until (11) - cmd (4)
- compile (11)
- concat (11)
- execute (11)
- gsub (22)
- gsub! (11)
- inspect (11)
- irb (11)
-
last
_ match (22) -
last
_ match _ tried (6) - match? (27)
- matched (11)
- matched? (11)
-
matched
_ count (6) -
matched
_ size (11) -
matched
_ string (6) - matchedsize (11)
- matches? (11)
-
matching
_ files (11) - names (11)
- new (11)
-
post
_ match (22) -
pre
_ match (22) - prune (6)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
scan
_ full (11) -
scan
_ until (11) -
skip
_ until (11) - sub (33)
- sub! (11)
-
to
_ a (11) -
to
_ s (11) -
unmatched
_ alias _ lists (11) - unscan (11)
-
values
_ at (11) - waitfor (4)
- クラス/メソッドの定義 (11)
- 正規表現 (11)
検索結果
先頭5件
-
Scanf
:: FormatString # last _ match _ tried (9101.0) -
@todo
@todo -
Scanf
:: FormatString # matched _ count (9100.0) -
@todo
@todo -
StringScanner
# matchedsize -> Integer | nil (9100.0) -
StringScanner#matched_size と同じです。
...
StringScanner#matched_size と同じです。
このメソッドは は将来のバージョンで削除される予定です。
代わりに StringScanner#matched_size を使ってください。
@see StringScanner#matched_size... -
Regexp
. last _ match(nth) -> String | nil (6274.0) -
整数 nth が 0 の場合、マッチした文字列を返します ($&)。それ以外では、nth 番目の括弧にマッチ した部分文字列を返します($1,$2,...)。 対応する括弧がない場合やマッチしなかった場合には nil を返し ます。
..."
p Regexp.last_match # => #<MatchData:0x4599e58>
p Regexp.last_match(0) # => "ab"
p Regexp.last_match(1) # => "a"
p Regexp.last_match(2) # => "b"
p Regexp.last_match(3) # => nil
//}
正規表現全体がマッチしなかった場合、引数なしの
Regexp.last_match はnil を返......すため、
last_match[1] の形式では例外 NoMethodError が発生します。
対して、last_match(1) は nil を返します。
//emlist[例][ruby]{
str = "This is Regexp"
/That is Regexp/ =~ str
p Regexp.last_match # => nil
begin
p Regexp.last_match[1] # 例外が発生する
rescue......puts $! # => undefined method `[]' for nil:NilClass
end
p Regexp.last_match(1) # => nil
//}
@param nth 整数を指定します。
整数 nth が 0 の場合、マッチした文字列を返します。それ以外では、nth 番目の括弧にマッチした部分文字列を返します。... -
Regexp
. last _ match -> MatchData (6244.0) -
カレントスコープで最後に行った正規表現マッチの MatchData オ ブジェクトを返します。このメソッドの呼び出しは $~ の参照と同じです。
... MatchData オ
ブジェクトを返します。このメソッドの呼び出しは $~
の参照と同じです。
//emlist[例][ruby]{
/(.)(.)/ =~ "ab"
p Regexp.last_match # => #<MatchData:0x4599e58>
p Regexp.last_match[0] # => "ab"
p Regexp.last_match[1] # => "a"
p Regexp.last_match[2]......# => "b"
p Regexp.last_match[3] # => nil
//}... -
REXML
:: Entity . matches?(string) -> bool (6223.0) -
string が実体宣言の文法に従う文字列であれば真を返します。
...string が実体宣言の文法に従う文字列であれば真を返します。
@param string 判定対象の文字列
//emlist[][ruby]{
require 'rexml/document'
p REXML::Entity.matches?('<!ENTITY s "seal">') # => true
p REXML::Entity.matches?('<!ENTITY % s "seal">') # => true
p REXML::Entity.......matches?('<!ELEMENT br EMPTY >') # => false
//}... -
Kernel
$ $ MATCH -> String | nil (6208.0) -
$& の別名
...$& の別名
require "English"
str = 'hoge,foo,bar,hee,hoo'
/(foo|bar)/ =~ str
p $MATCH #=> "foo"... -
Kernel
$ $ LAST _ PAREN _ MATCH -> String | nil (6202.0) -
$+ の別名
$+ の別名
require "English"
r1 = Regexp.compile("<img src=(http:.+?)>")
r2 = Regexp.compile("<a href=(http|ftp).+?>(.+?)</a>")
while line = DATA.gets
[ r1, r2 ].each {|rep|
rep =~ line
p $+
}
end
__END__
<tr> <td><img src=http://localhost/a.jpg></td> <td>ikkou</td>... -
Gem
:: GemPathSearcher # matching _ files(spec , path) -> [String] (6201.0) -
与えられた spec に path が含まれている場合、その path のリストを返します。
与えられた spec に path が含まれている場合、その path のリストを返します。
@param spec Gem::Specification のインスタンスを指定します。
@param path 探索対象のパスを指定します。 -
Kernel
$ $ POSTMATCH -> String | nil (6201.0) -
$' の別名
...$' の別名
require "English"
str = 'hoge,foo,bar,hee,hoo'
/foo/ =~ str
p $POSTMATCH #=> ",bar,hee,hoo"... -
Kernel
$ $ PREMATCH -> String | nil (6201.0) -
$` の別名
...$` の別名
require "English"
str = 'hoge,foo,bar,hee,hoo'
/foo/ =~ str
p $PREMATCH #=> "hoge,"...