title: Python regex match two string at two different order?
body: <p>I want to match <code>aaa bbb</code> and <code>bbb aaa</code> in the following string:</p>
  
  <pre><code>aaa  bbb   bbb    aaa
  </code></pre>
  
  <p>using</p>
  
  <pre><code>match = re.search("^(?=.*(aaa))(?=.*?(bbb)).*$", subject, re.DOTALL | re.IGNORECASE)
  </code></pre>
  
  <p>see <a href="https://www.regex101.com/r/vA0nB0/2" rel="nofollow">https://www.regex101.com/r/vA0nB0/2</a></p>
  
  <p>But it only match <code>aaa bbb</code>.</p>
  
  <p>How can I match <code>bbb aaa</code> too?</p>