6件ヒット
[1-6件を表示]
(0.128秒)
ライブラリ
- resolv (1)
-
shell
/ command-processor (1) - strscan (4)
クラス
キーワード
- echo (1)
- matched (1)
- matched? (1)
-
matched
_ size (1) - matchedsize (1)
検索結果
先頭5件
-
Resolv
:: DNS :: Resource :: TXT # strings -> [String] (63307.0) -
TXT レコードの文字列を配列で返します。
TXT レコードの文字列を配列で返します。 -
StringScanner
# matched -> String | nil (27304.0) -
前回マッチした部分文字列を返します。 前回のマッチに失敗していると nil を返します。
前回マッチした部分文字列を返します。
前回のマッチに失敗していると nil を返します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.matched # => nil
s.scan(/\w+/) # => "test"
s.matched # => "test"
s.scan(/\w+/) # => nil
s.matched # => nil
s.scan(/\s+/) # => " "
s.matched # => " "
//} -
StringScanner
# matched? -> bool (27304.0) -
前回のマッチが成功していたら true を、 失敗していたら false を返します。
前回のマッチが成功していたら true を、
失敗していたら false を返します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.matched? # => false
s.scan(/\w+/) # => "test"
s.matched? # => true
s.scan(/\w+/) # => nil
s.matched? # => false
s.scan(/\s+/) # => " "
s.matched? # => true
//} -
StringScanner
# matched _ size -> Integer | nil (27304.0) -
前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。
前回マッチした部分文字列の長さを返します。
前回マッチに失敗していたら nil を返します。
マッチしたサイズは文字単位でなくバイト単位となります。
//emlist[][ruby]{
require 'strscan'
def run(encode)
utf8 = "\u{308B 3073 3044}" # るびい
s = StringScanner.new(utf8.encode(encode))
s.scan(/#{"\u{308B}".encode(encode)}/)
s.matched_size
end
p run("UTF-8") #=> 3
p... -
StringScanner
# matchedsize -> Integer | nil (27304.0) -
StringScanner#matched_size と同じです。
StringScanner#matched_size と同じです。
このメソッドは は将来のバージョンで削除される予定です。
代わりに StringScanner#matched_size を使ってください。
@see StringScanner#matched_size -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (9325.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
実行すると, それらを内容とする Filter オブジェクトを返します.
@param strings シェルコマンド echo に与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "al...