Improve trailing whitespace regex.