Unwanted spaces around characters in regex
<p>Consider the following string variable:</p>

<pre><code>data = '23jodfjkle lj ioerz\nlkdsjflj sldjj\\difd ioiörjlezr'
</code></pre>

<p>What i want to create is string with alphabetical characters, character \n and character ö. Therefore i wrote the following: </p>

<pre><code>(" ".join(re.findall("[a-zA-Z]+|\n|ö", data)))
</code></pre>

<p>But what i take is:</p>

<pre><code>'jodfjkle ljkgfj opz ioerz \n lkdsjflj sldjj difd ioi ö rjlezr'
</code></pre>

<p>Why are there spaces around the characters \n and ö? What should i change in order to take a solution without spaces:</p>

<pre><code>'jodfjkle ljkgfj opz ioerz\nlkdsjflj sldjj difd ioiörjlezr'
</code></pre>