るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.021秒)

別のキーワード

  1. resolv regex
  2. resolv regex_8hex
  3. resolv regex_6hex4dec
  4. ipv6 regex_8hex
  5. ipv4 regex

ライブラリ

検索結果

StringScanner#scan_full(regexp, s, f) -> object (18404.0)

スキャンポインタの位置から regexp と文字列のマッチを試します。

...スキャンポインタの位置から regexp と文字列のマッチを試します。

マッチに成功すると、s と f の値によって以下のように動作します。

* s が true ならばスキャンポインタを進めます。
* s が false ならばスキャンポイ...
...ます。

* 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? と同...
...n'

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) #=> "string"
//}

@see StringScanner#scan S...