44件ヒット
[1-44件を表示]
(0.048秒)
モジュール
- Kernel (44)
キーワード
-
$ INPUT _ RECORD _ SEPARATOR (11) -
$ LAST _ MATCH _ INFO (11) -
$ LAST _ PAREN _ MATCH (11) -
$ RS (11)
検索結果
先頭4件
-
Kernel
$ $ INPUT _ RECORD _ SEPARATOR -> String | nil (6208.0) -
$/ の別名
...$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo... -
Kernel
$ $ LAST _ MATCH _ INFO -> MatchData | nil (6202.0) -
$~ の別名
...名
require "English"
str = "<a href=https://www.ruby-lang.org/en/about/license.txt>license</a>"
if /<a href=(.+?)>/ =~ str
p $LAST_MATCH_INFO[0] #=> "<a href=https://www.ruby-lang.org/en/about/license.txt>"
p $LAST_MATCH_INFO[1] #=> "https://www.ruby-lang.org/en/about/license.txt"......p $LAST_MATCH_INFO[2] #=> nil
end... -
Kernel
$ $ RS -> String | nil (3108.0) -
$/ の別名
...$/ の別名
require "English"
$INPUT_RECORD_SEPARATOR = '|'
array = []
while line = DATA.gets
array << line
end
p array #=> ["ugo|", "ego|", "fogo\n"]
__END__
ugo|ego|fogo... -
Kernel
$ $ LAST _ PAREN _ MATCH -> String | nil (108.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> <td......><a href=http://localhost/link.html>link</a></td> </tr>
#enf of sample.rb
$ ruby sample.rb
"http://localhost/a.jpg"
"link"...