title: Add a variable in RegExp
body: <p>I would like to use a variable in RegExp in this function.</p>
  <pre><code>checkSocial(platform, link) {
  let reg = new RegExp(/^(?:https?:\/\/)?(www\.facebook\.com\/)(?:\S+)/);
  return reg.test(link);
  }
  </code></pre>
  <p>Doing this:</p>
  <pre><code>let reg = new RegExp(`/^(?:https?:\/\/)?(www\.${platform}\.com\/)(?:\S+)/`);
  </code></pre>
  <p>or this:</p>
  <pre><code>let reg = new RegExp('^(?:https?:\/\/)?(www\.' + platform + '\.com\/)(?:\S+)');
  </code></pre>
  <p>didn't work. How can I add a variable?</p>