title: Regex: find text between two unknown tags
body: <p>i have a string like this :</p>
  
  <pre><code>&lt;!NAME!&gt;Admin : &lt;!NAME!&gt;&lt;!MSG!&gt;Hello Guys&lt;!MSG!&gt;&lt;!ADD-ACC!&gt;BOSS&lt;!ADD-ACC!&gt;
  </code></pre>
  
  <p>I want to write a regex pattern that extracts text between two same tags like </p>
  
  <pre><code>&lt;!NAME!&gt;Admin : &lt;!NAME!&gt;
  &lt;!MSG!&gt;Hello Guys&lt;!MSG!&gt;
  &lt;!ADD-ACC!&gt;BOSS&lt;!ADD-ACC!&gt;
  </code></pre>
  
  <p>So i wrote this regex : </p>
  
  <pre><code>&lt;!.*!&gt;.*&lt;!.*!&gt;
  </code></pre>
  
  <p>But it gave me this result </p>
  
  <pre><code>&lt;!NAME!&gt;Admin : &lt;!NAME!&gt;&lt;!MSG!&gt;Hello Guys&lt;!MSG!&gt;&lt;!ADD-ACC!&gt;BOSS&lt;!ADD-ACC!&gt;
  </code></pre>
  
  <p>I understand why it did so, it is because</p>
  
  <pre><code> &lt;!NAME!&gt; and &lt;!ADD-ACC!&gt; follows the regex pattern i am using.
  </code></pre>
  
  <p>So i was thinking of something like that in regex</p>
  
  <pre><code>&lt;!XXX!&gt;.*&lt;!XXX!&gt; where XXX is the same text between tags so that REGEX could find and extract those tags from text like how i want it to be done.
  </code></pre>