title: PHP Regex to match word in a sentence with optionally only other certain words
body: <p>I'm looking for a PHP regex to match a word in a sentence that will also optionally permit some other words in the sentence but the match should fail if there are any other words in the sentence that are not in the allowed list. For eg:</p>
  
  <pre><code>The quick fox
  </code></pre>
  
  <p>Here I'm looking for fox. 'The' and 'quick' are ok too if they appear. Since those words are optional then just </p>
  
  <pre><code>fox 
  </code></pre>
  
  <p>would be ok too. However, </p>
  
  <pre><code>The quick brown fox
  </code></pre>
  
  <p>is not ok. I don't want a brown fox.</p>
  
  <p>Feel free to suggest another way of doing this too but it needs to be blazing fast.</p>
  
  <p>EDIT: The words will come before fox but they can appear in any order so </p>
  
  <pre><code> quick The fox
  </code></pre>
  
  <p>should match too.</p>