Assistance with Python regex
<p>I have the following strings.</p>

<p>Example:</p>

<ul>
<li>12 CG GRB</li>
<li>6GRC 11.2 MK</li>
<li>2 GR 1.75LRG</li>
</ul>

<p>And I would like to break them to the following group</p>

<ul>
<li>[12,CG] [GRB]</li>
<li>[6,GRC] [11.2,MK]</li>
<li>[2,GR] [1.75,LRG]</li>
</ul>

<p>I'm using this regex - (\d+.?\d*).*?([A-Z]+) but with it, I'm unable to capture the first example correctly. Instead of [12,CG] [GRB], i get [12,CG].</p>

<p>Any help will be much appreciated.</p>

<pre><code>import re
p = re.compile(ur'(\d+\.?\d*).*?([A-Z]+)')
test_str = u"12 CG GRB"

re.findall(p, test_str)
</code></pre>

<pre><code>s = "12 CG GRB\n6GRC 11.2 MK\n2 GR 1.75LRG"
re.split(r"(?&lt;!\d)\s", s)
</code></pre>

<p>The output is:</p>

<pre><code>['12 CG', 'GRB', '6GRC', '11.2 MK', '2 GR', '1.75LRG']
</code></pre>

python regex