title: regex : how to eliminiate urls ending with .dtd
body: <p>This is JavaScript regex.</p>
  
  <pre><code>regex = /(http:\/\/[^\s]*)/g;
  
  text = "I have http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd and I like http://google.com a lot";
  
  matches = text.match(regex);
  
  console.log(matches);
  </code></pre>
  
  <p>I get both the urls in the result. However I want to eliminate all the urls ending with .dtd . How do I do that?</p>
  
  <p>Note that I am saying ending with .dtd should be removed. It means a url like <a href="http://a.dtd.google.com" rel="nofollow noreferrer">http://a.dtd.google.com</a> should pass .</p>