title: Regex bypass three dots only
body: <p>I have this string:</p>
  
  <pre><code>z='Certainly. I like apples... Really? By all means. Yes!'
  </code></pre>
  
  <p>I want to capture the <code>.</code>, <code>?</code> and <code>!</code> but not the <code>...</code> substring, so the desired output should be:</p>
  
  <pre><code>['.', '?', '.', '!']
  </code></pre>
  
  <p>This is what I've got:</p>
  
  <pre><code>&gt;&gt;&gt; re.findall('(?&lt;!\.)[\.?!]', z)
  ['.', '.', '?', '.', '!']
  </code></pre>
  
  <p>This regex is also capturing the first dot of the <code>...</code> substring. But if I run:</p>
  
  <pre><code>&gt;&gt;&gt; re.findall('(?&lt;!\.{2})[\.?!]', z)
  ['.', '.', '.', '?', '.', '!']
  </code></pre>
  
  <p>Quite the opposite of what I expected, and I don't understand why since I'm asking the lookahead to not match if two dots preceed (attempting to use quantifier any operator <code>+?*{1,2}</code> yields an error because look-behind requires fixed-width pattern).</p>
  
  <p>I'm misunderstanding something because I would expect that adding a second <code>\.</code> to the lookahead would yield my desired output. </p>
  
  <p>I would appreciate any suggestions and brief explanations (couldn't find anything exactly like what I'm asking).</p>