Only replace the matched attributes