title: Replacing content between two tags first occurence
body: <p>I am trying to replace some content between tags with the following expression</p>
  
  <pre><code>sed -i -e ':a;N;$!ba' -e 's#&lt;a href="/" class="logo"&gt;.*&lt;/a&gt;#&lt;a href="/" class="logo"&gt;{{{ svg "/myLogo.svg" 100 100 }}} &lt;img src="/logo.png"&gt;&lt;/a&gt;#' $file
  </code></pre>
  
  <p>The problem I am facing is I apply it to a text like:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="bar"&gt;
      &lt;a href="/" class="logo"&gt;
          &lt;svg viewBox="13.195 149.965 803 267.334"&gt;
                  &lt;path fill="#6A5B53" d="M233.773,218.468l-6.19,65.33c-3.429-29.427-19.904-64.188-41.427-82.473
                      c0.667-1.048-0.381-8,0.476-8.856L266.773,218.468z"/&gt;
                  &lt;path fill="#FFC3B7" d="M260.583,285.894c0.476-63.331-51.236-116.662-115.424-116.377/&gt;
       &lt;/svg&gt;
                  &lt;image src="/logo.jpg"&gt;          &lt;/svg&gt;
      &lt;/a&gt;
  
      &lt;ul class="newmenu"&gt;&lt;li&gt;&lt;a href="/char" title=""&gt;Char&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="/price" title=""&gt;Price&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="/account" title=""&gt;Account&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="/login" title=""&gt;Login&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;    &lt;div class="log"&gt;.....
  </code></pre>
  
  <p>So after I execute it, the script replaces it until the last <code>&lt;/a&gt;</code> instead of replacing up to the first <code>&lt;/a&gt;</code>.</p>
  
  <p>How can I prevent from replacing all the way up to the last tag?</p>