Split and keep deliminator, preferably with regex
<p>Let's say I have this text:</p>

<pre><code>1.1 This is the 2,1 first 1.2 This is the 2,2 second 1.3 This is the 2,3 third 
</code></pre>

<p>and I want:</p>

<pre><code>["1.1 This is the 2,1 first","1.2 This is the 2,2 second","1.3 This is the 2,3 third"]
</code></pre>

<p>Note that:</p>

<ul>
<li><p>I  can't use <code>re.findall</code>, since I can't think of a way to properly terminate the match. The best I could think of was <code>'[0-9]+\.[0-9]+^([0-9]+\.[0-9]+)*'</code>, which didn't work.</p></li>
<li><p>I can't just store the delimiter as a global variable, since it changes with each match.</p></li>
<li><p>I could not use a regular <code>re.split</code> because I want to keep the delimiter. I can't use a lookbehind because it has to be fixed width, and this isn't.</p></li>
</ul>

<p>I have read <a href="http://stackoverflow.com/questions/18323764/regexp-split-and-keep-the-seperator">regexp split and keep the seperator</a>, <a href="http://stackoverflow.com/questions/7866128/python-split-without-removing-the-delimiter">Python split() without removing the delimiter</a>, and <a href="http://stackoverflow.com/questions/2136556/in-python-how-do-i-split-a-string-and-keep-the-separators">In Python, how do I split a string and keep the separators?</a>, and still don't have an answer.</p>

<p>split with blank whose right is 1.2 2.2 ...</p>

<pre><code>re.split(r' (?=\d.\d)',s)
</code></pre>

python regex