title: Conditional construct not working in Python regex
body: <p>I an a newbie in python and I want to use my regex in <code>re.sub</code>. I tried it on <a href="https://regex101.com/r/InljCc/1" rel="nofollow noreferrer">regex101</a> and it works. Somehow when I tried to use it on my python (version 3.6) it doesn't work properly. I get the following warning</p>
  
  <blockquote>
    <p>bad character in group name '?=[^\t]*' at position 5</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>re = r"(?(?=[^\t]*)([\t]+))";
  str = 'a            bold, italic,           teletype';
  subst = ',';
  
  result = re.sub($re, $subst, $str);
  </code></pre>