Python - get string part from another string
<p>So I have a string</p>

<pre><code>"sdfsfsdfdsfsdfsd #.split.#style=background: black;"
</code></pre>

<p>I want to do some operations on it
I want to change the <code>#.split.#</code> part to a div close tag and open tag:</p>

<pre><code>str.replace("#.split.#", '&lt;/div&gt;&lt;div&gt;')
</code></pre>

<p>other than that i want to take the part after the <code>style=</code> and put into that  div open tag</p>

<p>what is a fast procedure to do that?
keep in mind that the <code>#.split.#style=</code> part, can occur multiple times in a string, and that the part after the <code>style=</code> can vary in length, but always ends in a linebreak.  </p>

<p><strong>edit:</strong></p>

<p>What i want to achieve is going from a string like this:</p>

<pre><code>"sdfsfsdfdsfsdfsd #.split.#style=background: black;
 sdfsfsdfdsfsdfsd #.split.#style=background: red;"
</code></pre>

<p>to this:</p>

<pre><code>'sdfsfsdfdsfsdfsd &lt;/div&gt;&lt;div style="background: black;"&gt;
 sdfsfsdfdsfsdfsd &lt;/div&gt;&lt;div style="background:red;"&gt;'
</code></pre>