title: Why does re.findall return a list of tuples when my pattern only contains one group?
body: <p>Say I have a string <code>s</code> containing letters and two delimiters <code>1</code> and <code>2</code>. I want to split the string in the following way: </p>
  
  <ul>
  <li>if a substring <code>t</code> falls between <code>1</code> and <code>2</code>, return <code>t</code></li>
  <li>otherwise, return each character</li>
  </ul>
  
  <p>So if <code>s = 'ab1cd2efg1hij2k'</code>, the expected output is <code>['a', 'b', 'cd', 'e', 'f', 'g', 'hij', 'k']</code>.</p>
  
  <p>I tried to use regular expressions:</p>
  
  <pre><code>import re
  s = 'ab1cd2efg1hij2k'
  re.findall( r'(1([a-z]+)2|[a-z])', s )
  
  [('a', ''),
   ('b', ''),
   ('1cd2', 'cd'),
   ('e', ''),
   ('f', ''),
   ('g', ''),
   ('1hij2', 'hij'),
   ('k', '')]
  </code></pre>
  
  <p>From there i can do <code>[ x[x[-1]!=''] for x in re.findall( r'(1([a-z]+)2|[a-z])', s ) ]</code> to get my answer, but I still don't understand the output. The <a href="https://docs.python.org/2/library/re.html" rel="noreferrer">documentation</a> says that <code>findall</code> returns a list of tuples if the pattern has more than one group. However, my pattern only contains one group. Any explanation is welcome.</p>