180件ヒット
[101-180件を表示]
(0.092秒)
別のキーワード
ライブラリ
- strscan (180)
キーワード
-
beginning
_ of _ line? (12) - bol? (12)
- empty? (12)
- eos? (12)
-
get
_ byte (12) - getbyte (12)
- getch (12)
- match? (12)
- matched? (12)
-
matched
_ size (12) - peek (12)
- peep (12)
- rest? (12)
-
scan
_ full (12) -
search
_ full (12)
検索結果
先頭5件
-
StringScanner
# getch -> String | nil (3114.0) -
一文字スキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すならnilを返します。
...ャンポインタが文字列の末尾を指すならnilを返します。
一文字の定義は、与えた文字列のエンコードに依存します。
//emlist[例][ruby]{
require 'strscan'
utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("UTF-8"))
p s.getch......# => "る"
p s.getch # => "び"
p s.getch # => "い"
p s.getch # => nil
//}... -
StringScanner
# empty? -> bool (3108.0) -
スキャンポインタが文字列の末尾を指しているなら true を、 末尾以外を指しているなら false を返します。
...。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.eos? # => false
s.scan(/\w+/)
s.scan(/\s+/)
s.scan(/\w+/)
s.eos? # => true
//}
StringScanner#empty? は将来のバージョンで削除される予定です。
代わりに StringScanner#eos? を使... -
StringScanner
# eos? -> bool (3108.0) -
スキャンポインタが文字列の末尾を指しているなら true を、 末尾以外を指しているなら false を返します。
...。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.eos? # => false
s.scan(/\w+/)
s.scan(/\s+/)
s.scan(/\w+/)
s.eos? # => true
//}
StringScanner#empty? は将来のバージョンで削除される予定です。
代わりに StringScanner#eos? を使... -
StringScanner
# matched? -> bool (3108.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? #... -
StringScanner
# rest? -> bool (3108.0) -
文字列が残っているならば trueを、 残っていないならば false を返します。
...返します。
StringScanner#eos? と逆の結果を返します。
StringScanner#rest? は将来のバージョンで削除される予定です。
代わりに StringScanner#eos? を使ってください。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.eos?... -
StringScanner
# scan _ full(regexp , s , f) -> object (3108.0) -
スキャンポインタの位置から regexp と文字列のマッチを試します。
...関係なく nil を返します。
このメソッドは s と f の組み合わせにより、
他のメソッドと同等の動作になります。
* scan_full(regexp, true, true) は StringScanner#scan と同等。
* scan_full(regexp, true, false) は StringScanner#skip と同等。......* scan_full(regexp, false, true) は StringScanner#check と同等。
* scan_full(regexp, false, false) は StringScanner#match? と同等。
@param regexp マッチに用いる正規表現を指定します。
@param s true ならばスキャンポインタを進めます。
false......mlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.scan_full(/\w+/, true, true) #=> "test"
p s.scan_full(/\s+/, false, true) #=> " "
p s.scan_full(/\s+/, true, false) #=> 1
p s.scan_full(/\w+/, false, false) #=> 6
p s.scan_full(/\w+/, true, true) #=> "strin... -
StringScanner
# search _ full(regexp , s , f) -> object (3108.0) -
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
...く nil を返します。
このメソッドは s と f の組み合わせにより、
他のメソッドと同等の動作になります。
* search_full(regexp, true, true) は StringScanner#scan_until と同等。
* search_full(regexp, true, false) は StringScanner#skip_until と同......等。
* search_full(regexp, false, true) は StringScanner#check_until と同等。
* search_full(regexp, false, false) は StringScanner#exist? と同等。
@param regexp マッチに用いる正規表現を指定します。
@param s true ならばスキャンポインタを進めます......mlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.search_full(/t/, true, true) #=> "t"
p s.search_full(/str/, false, true) #=> "est str"
p s.search_full(/string/, true, true) #=> "est string"
//}
@see StringScanner#scan_until StringScanner#skip_until String...