fix regular expression for trans and transchoice to support more cases #377; also fix some whitespace issues