added a regex for newlines fixes #1