In Files

Parent

Methods

Class/Module Index

IO

Public Instance Methods

scanf(str,&b)click to toggle source

The trick here is doing a match where you grab one line of
input at a time. The linebreak may or may not occur at the boundary where
the string matches a format specifier. And if it does, some rule about
whitespace may or may not be in effect…

That’s why this is much more elaborate than the string version.

For each line: Match succeeds (non-emptily) and the last attempted
spec/string sub-match succeeded: