title: Using regex pattern variable with preg_match
body: <p>I tried suggested solutions from other regex questions with preg_match but to no avail.</p>
  
  <pre><code>$match = '/^(.|a|an|and|the|this|at|in|or|of|is|for|to|its|as|by)\$/';
  $filteredArray = array_filter($wordArray, function($x){
  return !preg_match($match,$x);
  });
  </code></pre>
  
  <p>It works when I include the string literal but I'd like to use a variable so I can add more words.  This version works:</p>
  
  <pre><code>$filteredArray = array_filter($wordArray, function($x){
  return !preg_match("/^(.|a|an|and|the|this|at|in|or|of|is|for|to|its|as|by)$/",$x);
  });
  </code></pre>
  
  <p>I appreciate any help!</p>