176件ヒット
[1-100件を表示]
(0.155秒)
モジュール
- Kernel (176)
キーワード
-
$ CHILD _ STATUS (11) -
$ FIELD _ SEPARATOR (11) -
$ FS (11) -
$ INPUT _ LINE _ NUMBER (11) -
$ INPUT _ RECORD _ SEPARATOR (11) -
$ LAST _ MATCH _ INFO (11) -
$ LAST _ PAREN _ MATCH (11) -
$ LOADED _ FEATURES (11) -
$ LOAD _ PATH (11) -
$ MATCH (11) -
$ NR (11) -
$ OUTPUT _ FIELD _ SEPARATOR (11) -
$ OUTPUT _ RECORD _ SEPARATOR (11) -
$ POSTMATCH (11) -
$ PREMATCH (11) -
$ RS (11)
検索結果
先頭5件
-
Kernel
$ $ LAST _ PAREN _ MATCH -> String | nil (18431.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>ikko......u</td> <td><a href=http://localhost/link.html>link</a></td> </tr>
#enf of sample.rb
$ ruby sample.rb
"http://localhost/a.jpg"
"link"... -
Kernel
$ $ FIELD _ SEPARATOR -> String | nil (18407.0) -
$; の別名
...$; の別名
require "English"
str = "hoge,fuga,ugo,bar,foo"
p str.split #=> ["hoge,fuga,ugo,bar,foo"]
$FIELD_SEPARATOR = ","
p str.split #=> ["hoge", "fuga", "ugo", "bar", "foo"]... -
Kernel
$ $ CHILD _ STATUS -> Process :: Status | nil (15525.0) -
$? の別名
...$? の別名
require "English"
out = `wget https://www.ruby-lang.org/en/about/license.txt -O - 2>/dev/null`
if $CHILD_STATUS.to_i == 0
print "wget success\n"
out.split(/\n/).each { |line|
printf "%s\n", line
}
else
print "wget failed\n"
end... -
Kernel
$ $ LAST _ MATCH _ INFO -> MatchData | nil (15525.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.tx......t"
p $LAST_MATCH_INFO[2] #=> nil
end... -
Kernel
$ $ LOAD _ PATH -> [String] (15473.0) -
Rubyライブラリをロードするときの検索パスです。
...Rubyライブラリをロードするときの検索パスです。
Kernel.#load や Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。
起動時にはコマンドラインオプション -I で指定したディレクトリ、......境変数 RUBYLIB の値、
コンパイル時に指定したデフォルト値
をこの順番で含みます。
以下に典型的な UNIX システム上でのロードパスを示します。
-I で指定したパス
環境変数 RUBYLIB の値
/usr/local/lib/ruby/site_ruby/VERSION......リ
/usr/local/lib/ruby/site_ruby/VERSION/ARCH サイト固有、システム依存、拡張ライブラリ
/usr/local/lib/ruby/site_ruby サイト固有ライブラリ
/usr/local/lib/ruby/VERSION 標準ライブラリ
/usr/local/lib/ruby/VERSION/ARCH... -
Kernel
$ $ LOADED _ FEATURES -> [String] (15423.0) -
Kernel.#require でロードされたファイル名を含む配列です。
...Kernel.#require でロードされたファイル名を含む配列です。
Kernel.#require で同じファイルを
複数回ロードしないようにするためのロックとして使われます。
この変数はグローバルスコープです。... -
Kernel
$ $ INPUT _ RECORD _ SEPARATOR -> String | nil (15407.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
$ $ OUTPUT _ FIELD _ SEPARATOR -> String | nil (15407.0) -
$, の別名
...$, の別名
require "English"
array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo"... -
Kernel
$ $ PREMATCH -> String | nil (15407.0) -
$` の別名
...$` の別名
require "English"
str = 'hoge,foo,bar,hee,hoo'
/foo/ =~ str
p $PREMATCH #=> "hoge,"... -
Kernel
$ $ INPUT _ LINE _ NUMBER -> Integer (12413.0) -
$. の別名
...$. の別名
1 e
2 f
3 g
4 h
5 i
# end of a.txt
require "English"
File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb
ruby sample.rb a.txt
#=> 5...