Simple scanf function. Takes an input string, a pattern, and a
vector. It returns 0 if the format didn't match, and appends
all found elements to the given vector. Return values:
-1 string matched format ending with % (i.e. more chars than format cared about)
0 string didn't match format
1 string matched, but would still match if the right chars were added
2 string matched, and would not if any character would be added
var r = string.scanf("comm3freq123.456", "comm%ufreq%f", var result = []);
The result vector will be set to [3, 123.456].