title: python regex with differing length "or" in look-behind
body: <p>I have many logs with commands in it. I filtered all logs with "useradd" in them, but now I want to dicard some false positives:</p>
  
  <ul>
  <li>... /etc/default/useradd ...</li>
  <li>... .../man8/useradd ...</li>
  </ul>
  
  <p>The problem is that I want to see lines with false positive AND real command in them (see test cases).</p>
  
  <p>I can only use (one or more) python regular expressions as I am using a log analyzer program - so no real python program.
  These are the expressions I tried:</p>
  
  <pre><code>(!/etc/default/|/man8/)useradd # no match
  (?&lt;!/etc/default/|/man8/)useradd # look-behind requires fixed-width pattern
  (?&lt;!fault/|/man8/)useradd # works, but that's strange
  </code></pre>
  
  <p>In answers to other questions the regex was changed so that a lookahead could be used - but I don't see how this is possible here.</p>
  
  <p><strong>[Edit: added some test cases]</strong></p>
  
  <pre><code>## no match
  cat /etc/default/useradd 
  less /usr/share/man/ja/man8/useradd.8.gz
  ## match:
  useradd evil
  /usr/sbin/useradd
  cat /etc/default/useradd; useradd evil
  cat /etc/default/useradd; /usr/sbin/useradd evil
  cat /etc/default/useradd; cd /usr/lib/; ../sbin/useradd evil
  </code></pre>