The regexp used to distinguish attachment is updated to adapt various situations