title: Check if a set of string is contained in a string
body: <p>I'm facing a problem with Angular/Typescript, but it can be applied on the most of programming languages.</p>
  
  <p>I have a huge text that we will call <strong>fulltext</strong> and a set of <strong>filters</strong> that are applied on fulltext and know if they match; let me explain better:</p>
  
  <p>suppose our fulltext is something like this</p>
  
  <blockquote>
    <p>"Hello there! My name is Mattia"</p>
  </blockquote>
  
  <p>and the filters are </p>
  
  <blockquote>
    <p>["my name", "is Mattia"]</p>
  </blockquote>
  
  <p>First of all, I perform an operation of stamming and cleaning the fulltext and the filters, applying regex and replace.</p>
  
  <pre><code>document.snippet.toLowerCase().replace(/[^A-Z0-9]/ig, "");
  filter.toLowerCase().replace(/[^A-Z0-9]/ig, "");
  </code></pre>
  
  <p>So now I can avoid various false positives such as the mismatch between "Mattia" and "mattia" etc...</p>
  
  <p>At this point the answer can be trivial: I just scroll the list of filters and use the "include" string method. But suppose you have "mat" instead of "mattia" as a filter. Include uses substring, so it would return true in any case.</p>
  
  <p>In my context, I have some objects called "sections" numbered through romanic numbering (i, ii, iii, ...) contained within the fulltext. So, where a "section i" filter is applied, the method in question must return false if present "... section ii ...", "... section iii ...".</p>
  
  <p>I almost forgot, all filters must be satisfied, so if even one does not match, the method must return false.</p>
  
  <p>I hope I've made the problem as clear as I can.</p>