regex to remove the first duplicated attachment