safe removing whitespace and line endings using regexp