Issue #12035 has been updated by Nobuyoshi Nakada.

Status changed from Open to Rejected

From http://ruby-doc.org/stdlib-2.2.4/libdoc/scanf/rdoc/Scanf.html#module-Scanf-label-Conversions

> Matches a nonempty sequence of characters from the specified set of accepted characters. **The usual skip of leading white space is suppressed.**

----------------------------------------
Bug #12035: scanf suspicious results.
https://bugs.ruby-lang.org/issues/12035#change-56981

* Author: Peter Camilleri
* Status: Rejected
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-cygwin], ruby 2.1.6p336 (2015-04-13 revision 50298) [i386-mingw32], and ruby 1.9.3p484 (2013-11-22) [i386-mingw32]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
The code: 'a b c'.scanf('%[a] %[b] %[c]')

yields the result: ["a"] and not ["a","b","c"] as expected.

So far it seems that when sets of characters are used, only 
the first one in the parse specification string actually returns 
any data.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>