remove redundant whitespaces within regular expressions