title: Regex to match required/optional elements and nothing else
body: <p>I need a regex to match two items in any order, but also allow two other optional elements. The regex should only match these two to four items, and nothing else.</p>
  
  <p>For example, I want to match "high" and "unrounded" with optional "back" and "tense".</p>
  
  <p>Input: </p>
  
  <pre><code>high back tense unrounded     # ==&gt; match (two required elements + two optional)
  high unrounded                # ==&gt; match (just two required, no optional elements)
  unrounded high                # ==&gt; match (two required elements, any order)
  high back unrounded           # ==&gt; match (two required elements and one optional one)
  tense unrounded back high     # ==&gt; match (any order + optional elements)
  lax unrounded                 # ==&gt; no match (doesn't include one required element)
  high back tense unrounded lax # ==&gt; no match (includes more than the two required and two optional elements)
  </code></pre>
  
  <p>Her's my current Regex:</p>
  
  <pre><code>(?i)(?=.*high)((?=.*back))?((?=.*tense))?(?=.*unrounded)
  </code></pre>
  
  <p>It matches everything that I want but also matches things like the last example - which I don't want. Can I get it to NOT match with something that contains more than these two required elements and two optional elements?</p>