title: Regex to match text between two strings, including the strings
body: <p>I'm trying to fix some conflicts in a merge by git, there are a lot of &lt;&lt;&lt;&lt;&lt;&lt; HEAD and ====== blocks I want to be able to just find and replace with an empty string in a lot of files.</p>
  
  <p>I found this regex pattern that correctly matches everything between the two strings, but it leaves out the beginning and ending strings, and I want to be able to match them also.</p>
  
  <pre><code>(?s)(?&lt;=&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD).*?(?=\=\=\=\=\=\=\=)
  </code></pre>
  
  <p>So, match &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD, ======= and everything between them to do a search/replace.</p>
  
  <p>Can anyone help me out? I would be running this on files I'm certain I don't want anything between those strings, I guess that's also why I didn't try a "use theirs" flag when doing the merge, because I need to see the files first.</p>