別のキーワード
種類
- インスタンスメソッド (570)
- 特異メソッド (42)
- クラス (36)
- 文書 (29)
- 定数 (24)
ライブラリ
-
cgi
/ core (12) - csv (12)
- resolv (24)
- shell (6)
-
shell
/ builtin-command (6) -
shell
/ command-processor (6) -
shell
/ filter (6) - strscan (600)
クラス
- CGI (12)
-
Resolv
:: DNS :: Resource :: TXT (24) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Echo (6) -
Shell
:: Filter (6) - StringScanner (576)
キーワード
- << (12)
- CSV (12)
- Error (12)
- Id (12)
-
NEWS for Ruby 3
. 0 . 0 (5) - StringScanner (12)
- Version (12)
- [] (12)
-
beginning
_ of _ line? (12) - bol? (12)
- charpos (12)
- check (12)
-
check
_ until (12) - clear (12)
- concat (12)
- echo (18)
- empty? (12)
- eos? (12)
- exist? (12)
-
get
_ byte (12) - getbyte (12)
- getch (12)
- inspect (12)
- match? (12)
- matched (12)
- matched? (12)
-
matched
_ size (12) - matchedsize (12)
-
must
_ C _ version (12) - new (30)
- peek (12)
- peep (12)
- pointer (12)
- pointer= (12)
- pos (12)
- pos= (12)
-
post
_ match (12) -
pre
_ match (12) - print (12)
- reset (12)
- rest (12)
- rest? (12)
-
rest
_ size (12) - restsize (12)
-
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) - scan (12)
-
scan
_ full (12) -
scan
_ until (12) -
search
_ full (12) - skip (12)
-
skip
_ until (12) - string (12)
- string= (12)
- terminate (12)
- unscan (12)
検索結果
先頭5件
-
StringScanner
# check(regexp) -> String | nil (3000.0) -
現在位置から regexp とのマッチを試みます。 マッチに成功したらマッチした部分文字列を返します。 マッチに失敗したら nil を返します。
...インタを進めません。
@param regexp マッチに用いる正規表現を指定します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.check(/\w+/) # => "test"
s.pos # => 0
s.matched # => "test"
s.check(/\s+/) # => nil
s.matched # => n... -
StringScanner
# check _ until(regexp) -> String | nil (3000.0) -
regexp が一致するまで文字列をスキャンします。 マッチに成功したらスキャン開始位置からマッチ部分の末尾までの部分文字列を返します。 マッチに失敗したら nil を返します。
...インタを進めません。
@param regexp マッチに用いる正規表現を指定します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.check_until(/str/) # => "test str"
s.matched # => "str"
s.pos # => 0
s.pre_match # =... -
StringScanner
# clear -> self (3000.0) -
スキャンポインタを文字列末尾後まで進め、マッチ記録を捨てます。
...ist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.scan(/\w+/) # => "test"
s.matched # => "test"
s.pos # => 4
s[0] # => "test"
s.terminate
s.matched # => nil
s[0] # => nil
s.pos # => 11
//}
StringScanner#clear は将来のバージョ......ンで削除される予定です。
代わりに StringScanner#terminate を使ってください。... -
StringScanner
# concat(str) -> self (3000.0) -
操作対象の文字列に対し str を破壊的に連結します。 マッチ記録は変更されません。
...[例][ruby]{
require 'strscan'
s = StringScanner.new('test') # => #<StringScanner 0/4 @ "test">
s.scan(/\w(\w*)/) # => "test"
s[0] # => "test"
s[1] # => "est"
s << ' string' # => #<StringScanner 4/11 "test" @ " stri...">
s......"string"
//}
この操作は StringScanner.new に渡した文字列にも影響することがあります。
//emlist[例][ruby]{
require 'strscan'
str = 'test'
s = StringScanner.new(str) # => #<StringScanner 0/4 @ "test">
s << ' string' # => #<StringScanner 0/11 @ "test ...">
str... -
StringScanner
# empty? -> bool (3000.0) -
スキャンポインタが文字列の末尾を指しているなら true を、 末尾以外を指しているなら false を返します。
...例][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 (3000.0) -
スキャンポインタが文字列の末尾を指しているなら true を、 末尾以外を指しているなら false を返します。
...例][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
# exist?(regexp) -> Integer | nil (3000.0) -
スキャンポインタの位置から,次にマッチする文字列の末尾までの長さを返します。
...ポインタを進めません。
@param regexp マッチに用いる正規表現を指定します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.exist?(/s/) # => 3
s.exist?(//) # => 0
s.scan(/\w+/) # => "test"
s.exist?(/s/) # => 2
s.exist?(/e/) # => nil
//}... -
StringScanner
# get _ byte -> String | nil (3000.0) -
1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。
...指すなら nil を返します。
StringScanner#getbyte は将来のバージョンで削除される予定です。
代わりに StringScanner#get_byte を使ってください。
//emlist[例][ruby]{
require 'strscan'
utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p... -
StringScanner
# getbyte -> String | nil (3000.0) -
1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。
...指すなら nil を返します。
StringScanner#getbyte は将来のバージョンで削除される予定です。
代わりに StringScanner#get_byte を使ってください。
//emlist[例][ruby]{
require 'strscan'
utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p...