i. missed up the code
digits = '0123456789'
patt = "foo=" SPAN(digits) . num
while line = INPUT
if line ? patt
OUTPUT = num
endif
end