title: Regex to match pattern with subdomain in java gives issues
body: <p>I am trying to match the sub domain of an url using <code>http://([a-z0-9]*.)?example.com/.*</code> which works perfectly for these cases.</p>
  
  <pre><code>http://example.com/index.html
  http://test.example.com/index.html
  http://test1.example.com/index.html
  http://www.example.com/122/index.html
  </code></pre>
  
  <p>But the problem is it matches for this URL too.
  <a href="http://www.test.com/?q=http://example.com/index.html" rel="nofollow">http://www.test.com/?q=http://example.com/index.html</a></p>
  
  <p>if an URL with another domain has the URL in path it matches.Can any one tell me how to match for current domain only. getting the host will work but i need to match full URL.</p>