title: Python Regex Matching Two Strings If another String not Between
body: <p>I want to search <code>AA*ZZ</code> only if <code>*</code> does not contain <code>XX</code>.</p>
  <p>For 2 strings:</p>
  <pre><code>&quot;IY**AA**BMDHRPONWUY**ZZ**&quot;
  &quot;BV**AA**BDMYB**XX**W**ZZ**CKU&quot;
  </code></pre>
  <p>how can I match regex only with the first one?</p>