title: sed: delete characters between two strings
body: <p>I'd like to use sed to remove all characters between "foo=1&amp;" and "bar=2&amp;" for all occurrences in an xml file.</p>
  
  <pre><code>&lt;url&gt;http://example.com?addr=123&amp;foo=1&amp;s=alkjasldkffjskdk$bar=2&amp;f=jkdng&lt;/url&gt;
  &lt;url&gt;http://example.com?addr=124&amp;foo=1&amp;k=d93ndkdisnskiisndjdjdj$bar=2&amp;p=dnsks&lt;/url&gt;
  </code></pre>
  
  <p>Here is my sed command:</p>
  
  <pre><code>sed -e '/foo=1&amp;/,/bar=2&amp;/d' sample.xml
  </code></pre>
  
  <p>When I run this, the file is unchanged. </p>
  
  <p>The above is based on this example: <a href="https://stackoverflow.com/questions/16297932/find-string1-and-delete-between-that-and-string2">Find &quot;string1&quot; and delete between that and &quot;string2&quot;</a></p>