use regex in append function.