Fixing regexes to strip trailing whitespace