title: Match .jpg file extension in URL using regular expression
body: <p>I have a requirement to find out if a given URL contains an image with .jpg extension.  If it does, then I have to remove this extension.</p>
  
  <p>Example:
  Request URL: <a href="http://www.example.com/image.jpg" rel="nofollow">http://www.example.com/image.jpg</a></p>
  
  <p>The result should look like: <a href="http://www.example.com/image" rel="nofollow">http://www.example.com/image</a></p>
  
  <p>Can anyone help me with a regex for matcing .jpg and removing it?</p>