 <p>You can split your text with <code>\w+=</code> that will returns the following result :</p> <pre><code>&gt;&gt;&gt; re.split(r'(\w+=)',s) ['', 'name=', 'This is tricky ', 'pos=', '81 ', 'key=', '4565 ', 'count=', '1 ', 'pass=', 'a_23 ', 'find=', '2'] </code></pre> <p>then use <code>zip</code> within a list comprehension the concatenate the relevant elements :</p> <pre><code>&gt;&gt;&gt; sp=re.split(r'(\w+=)',s)[1:] &gt;&gt;&gt; [''.join(i) for i in zip(sp[0::2],sp[1::2])] ['name=This is tricky ', 'pos=81 ', 'key=4565 ', 'count=1 ', 'pass=a_23 ', 'find=2'] </code></pre>