5件ヒット
[1-5件を表示]
(0.170秒)
クラス
キーワード
- matched (1)
- matched? (1)
-
matched
_ size (1) - matchedsize (1)
検索結果
先頭5件
-
Resolv
:: DNS :: Resource :: TXT # strings -> [String] (81907.0) -
TXT レコードの文字列を配列で返します。
TXT レコードの文字列を配列で返します。 -
StringScanner
# matched -> String | nil (36604.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 _ size -> Integer | nil (36604.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 (36604.0) -
StringScanner#matched_size と同じです。
StringScanner#matched_size と同じです。
このメソッドは は将来のバージョンで削除される予定です。
代わりに StringScanner#matched_size を使ってください。
@see StringScanner#matched_size -
StringScanner
# matched? -> bool (36304.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
//}