perl -nle ' print "$1$2" if /(?=name=(\w+))(?=age=(\d+))/' filename