title: Regex detect linebreak inside a XML node
body: <p>I'm having troubles with a regexp. I'm looking through a set of XML files, and trying to detect some text inside specific nodes that contain a line break.</p>
  
  <p>Here is some sample data:</p>
  
  <pre><code>&lt;item name='GenMsgText'&gt;&lt;text&gt;The signature will be discarded.&lt;/text&gt;&lt;/item&gt;
  
  &lt;item name='GenMsgText'&gt;&lt;text&gt;The signature will be discarded.&lt;break/&gt;
  Do you want to continue?&lt;/text&gt;&lt;/item&gt;
  </code></pre>
  
  <p>In that sample, I want to catch only the text in the second node. I've come up with the below solution that uses a second regexp, but I'd like to know if I can do the same thing using only one.</p>
  
  <pre><code>if ($content =~m{&lt;item name='GenMsgText'&gt;(&lt;textlist&gt;)?&lt;text&gt;(.*?)&lt;/text&gt;}si)
    {
      $t = $2;
      if ($t =~m {\n}i)
      {
       print G $t."\n\n";
      }
  }
  </code></pre>
  
  <hr>
  
  <p>This is for a one-shot tool that isn't meant to be reused, so I'd like to avoid having to write any parsing code that's more than a few lines. Besides, the code above already works, I asked the question for personal knowledge more than for real use.</p>