title: Regex to Find Replace Beginning and End of String
body: <p>My skills are very basic. I'm hoping to find a regular expression for <strong>Sublime Text 3</strong> that finds a string by beginning and end. I'd like to keep the middle unchanged and I only want to replace the beginning and the end.</p>
  
  <p>For instance. Search for url with <code>/shop/</code> at the beginning and .htm at the end. I'd then like to replace <code>/shop/</code> with <code>/product/</code> and replace <code>.htm</code> with a forward <code>/</code></p>
  
  <p>e.g.</p>
  
  <pre><code>http://www.website.com/shop/ford-truck-hitch-extension.htm
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code>http://www.website.com/product/ford-truck-hitch-extension/
  </code></pre>
  
  <p>This bit finds the instances but I can't figure out how to replace the beginning and end.</p>
  
  <pre><code>shop[^&lt;]+.htm
  </code></pre>