Pike v8.0 release 1738

Method Stdio.Buffer()->match()


Method match

mixed match(string(8bit) format)

Description

Reads data from the beginning of the buffer to match the specifed format, then return the match.

The non-matching data will be left in the buffer.

This function is very similar to sscanf, but the result is the sum of the matches. Most useful to match a single value.

Example
// get the next whitespace separated word from the buffer.
 buffer->match("%*[ \t\r\n]%[^ \t\r\n]");