title: How do I have regex to match exact multiple domains without anything in front or end?
body: <p>I'd like to whitelist domains and I have this list as </p>
  
  <p><code>(domain1.com|domain2.com)</code></p>
  
  <p>However, it will still match to </p>
  
  <p><code>ci.domain1.com</code></p>
  
  <p><a href="https://regex101.com/r/A2IOJE/1/" rel="nofollow noreferrer">https://regex101.com/r/A2IOJE/1/</a></p>
  
  <p>I'm writing the code in node.js</p>
  
  <p>Here's the code</p>
  
  <pre><code>new RegExp('(domain1.com|domain2.com)', 'igm').test('ci.domain1.com');
  </code></pre>