title: Regex to match xml elements without child nodes
body: <p>I surprised I can't find this so if someone just closes this down as a duplicate and points me in the right direction that's great BUT</p>
  
  <p>I have xml and sometimes the text node is simple i.e.</p>
  
  <pre><code>&lt;text&gt;Sometext&lt;/text&gt;
  </code></pre>
  
  <p>And sometimes complex</p>
  
  <pre><code>&lt;text in_force_from="20061231" newpara="N"&gt;
     &lt;changed-by in_force_from="20140101"&gt;PRA 2013/34&lt;/changed-by&gt;
     &lt;changed-by in_force_from="20061231"&gt;2006/40&lt;/changed-by&gt;
      This section applies to:
  &lt;/text&gt;
  </code></pre>
  
  <p>I want to match <strong>all the simple ones only</strong> (e.g. <code>&lt;text&gt;Sometext&lt;/text&gt;</code>) so with something like this</p>
  
  <pre><code>&lt;text [\S\s]*?&gt;[^&lt;]*?&lt;/text&gt;
  </code></pre>
  
  <p>OR maybe</p>
  
  <pre><code>&lt;text [\S\s]*?&gt;(?!&lt;)*&lt;/text&gt;
  </code></pre>
  
  <p>But it's causing notepad++ to grind to a halt. I suspect it's going past the node and trying to match the next text closing tag even if this is 5000 lines away and not part of that node.</p>
  
  <p>What I want it to do is</p>
  
  <ol>
  <li>Find a text tag</li>
  <li>Has this text tag got other tags in</li>
  <li>If yes then match</li>
  <li>If no then don't continue with this match. Go and find the next text tag</li>
  </ol>
  
  <p>It's the 4th step that's causing the problem. Any ideas? Is this even possible in regex? Am I missing something obvious?</p>