title: RegEx - JavaScript .match() with a variable keyword
body: <p>I have a string with keywords, separated by comma's.</p>
  
  <p>Now I also have a nice <strong>RegEx</strong>, <em>to filter out all the keywords in that string, that matches a queried-string</em>.</p>
  
  <p>Check out this initial question - <a href="https://stackoverflow.com/questions/25094811/regex-extract-words-that-contains-a-substring-from-a-comma-seperated-string">RegEx - Extract words that contains a substring, from a comma seperated string</a></p>
  
  <p>The example below works fine; it has a masterString, and a resultString. That last one only contains the keywords that has at least the word "<strong>car</strong>" in it.</p>
  
  <pre><code>masterString = "typography,caret,car,align,shopping-cart,adjust,card";
  resultString = masterString.match(/[^,]*car[^,]*/g);
  console.log(resultString);
  </code></pre>
  
  <p>Result from the code above;</p>
  
  <pre><code>"caret", "car", "shopping-cart", "card"
  </code></pre>
  
  <p>But how can I use the RegEx, with a variable matching-word (the word "<strong>car</strong>" in this example static and not variable).</p>
  
  <p>I think it has to do something with a RegExp - but I can't figure out...</p>