while() { if(/\{B00(.+?):B00(.+?)\}/){ $values{$2} = $1; print "$1:$2:$values{$2}\n"; } }