Python - merge repeating characters (ins sequence) in string?
<p>When I have specific character that repeats more than once in a sequence, I want to merge it, so there won't be same adjacent characters.</p>

<p>For example:</p>

<pre><code>s = 'aa.bc.a.d.aaa.z'
# after merging repeating "a" character in a sequence:
</code></pre>

<p><strong>Output should be</strong>: <code>a.bc.a.d.a.z</code></p>

<p>P.S. I was able to find start and end indexes of such matches (with regex), but still can't see normal way of just merging those like I need.</p>

<p>Just to clarify how I found it:</p>

<pre><code>import re
f = re.finditer('(a){2,}', s)
for match in f:
  match.span()
(0, 2)
(10, 13)
</code></pre>