title: Regex match if all characters in a dictionary word are present in the phrase. The number of times each character occurs must also match in each other
body: <p>I'm writing a recursive backtracking search to find anagrams for a phrase. For the first step, I'm trying to filter out all the wrong words from a dictionary before I feed it to the recursive algorithm.</p>
  <p>The dictionary file looks like this:</p>
  <pre><code>aback
  abacus
  abalone
  abandon
  abase
  ... 
  [40,000 more words]
  </code></pre>
  <p>The regex I want to construct must filter out words that contain characters that the phrase do not contain, and also words that contain more occurrences of a character than exists in the phrase.</p>
  <p>For example, given the phrase &quot;clint eastwood&quot;, the word &quot;noodle&quot; matches, but the word &quot;stonewall&quot; does not, since &quot;stonewall&quot; contains more &quot;l&quot; characters than &quot;clint eastwood&quot; does.</p>
  <p>Simply using <code>&quot;[clint eastwood]+&quot;</code> as the regex almost does what I want, but it includes words with any number of the characters in the phrase.</p>