whitespace regex refactor