improves regex for whitespace replacement