title: A regex that cannot match (for a generated expression)
body: <p>In my code I generate a regular expression from a list of subexpressions. Joining expressions works fine if I put each of them in a non-matching group <code>(?:…)</code>:</p>
  
  <pre><code># concatenation:
  joined_expr = ''.join('(?:{})'.format(expr) for expr in subexpression)
  # disjunction:
  joined_expr = '|'.join('(?:{})'.format(expr) for expr in subexpression)
  </code></pre>
  
  <p>Problem is: The result of this joined expression is a subexpression for a bigger expression, and <code>subexpression</code> could be empty, but the joined expression must not match the empty string.</p>
  
  <p>So what would be the easiest why to make <strong>a regular expression, that cannot match</strong>? Would <code>(?:(?!.).)</code> work? If not, why not? Would Python's <code>re</code> engine understand my attempt to create a failing branch and optimize it?</p>