Added regular expression parsing so that [[ATTACHMENT| prefix and ]] suffix don't have to occupy a whole line