title: JavaScript match multiple values in comma separated strings
body: <p>Hi I have a string with a bunch of numbers</p>
  
  <pre><code>var matches = '128,126,125,124,123,122,118,117,116,115,99,98,97';
  </code></pre>
  
  <p>and I would like to check with a different sub string if the values matches with the within the string provided above</p>
  
  <pre><code>var numbers = '126,125';
  </code></pre>
  
  <p>I have tried the regular expression</p>
  
  <pre><code>if( $(this).attr('data-ids').match(new RegExp("(?:^|,)"+matches+"(?:,|$)"))){console.log('found'); 
  }else {console.log('not found')}
  </code></pre>
  
  <p>But the regex works for a single value not for multiple values</p>
  
  <pre><code>var numbers = '125';
  </code></pre>
  
  <p>I want this to work with single and multiple matches.</p>