title: Java - Need some help on a Regex pattern for matching both http and https
body: <p>I'm struggling with getting my regex pattern to match. Here are my requirements...</p>
  
  <p>Match the following domain ex, (google.com) with both http and https.</p>
  
  <p>I have an array list of various URL's....</p>
  
  <pre><code>http://stackoverflow.com/questions/ask
  https://ask.com/search
  http://google.com/images
  https://google.com/images
  </code></pre>
  
  <p>This is my Pattern:</p>
  
  <pre><code>final Pattern p = Pattern.compile( "(http:(?!.*google.com).*)" );
  </code></pre>
  
  <p>However, it's currently returning true for all my url's.</p>
  
  <p>Again, I only want it to return true if <a href="http://www.google.com" rel="nofollow">http://www.google.com</a> or <a href="https://www.google.com" rel="nofollow">https://www.google.com</a> matches my current url.</p>