title: Java Regex Matcher Question
body: <p>How do I match an URL string like this:</p>
  
  <p>img src = "<a href="https://stackoverflow.com/a/b/c/d/someimage.jpg">https://stackoverflow.com/a/b/c/d/someimage.jpg</a>"</p>
  
  <p>where only the domain name and the file extension (jpg) is fixed while others are variables?</p>
  
  <p>The following code does not seem working:</p>
  
  <pre><code>Pattern p = Pattern.compile("&lt;img src=\"http://stachoverflow.com/.*jpg");
      // Create a matcher with an input string
      Matcher m = p.matcher(url);
      while (m.find()) {
       String s = m.toString();
      }
  </code></pre>