title: How to show only first match in pcregrep?
body: <p>I have xml in log-files, that looks like:</p>
  
  <pre><code>&lt;ServiceRs&gt;
  1
  &lt;/ServiceRs&gt;
  text text text
  &lt;ServiceRs&gt;
  2
  &lt;/ServiceRs&gt;
  text
  </code></pre>
  
  <p>So, i need to cut this XML from log file and i'm trying to do this with:</p>
  
  <pre><code>pcregrep -M '&lt;ServiceRs&gt;(\n|.)*&lt;/ServiceRs&gt;'
  </code></pre>
  
  <p>But after this i didn't get two ServiceRs xml's, i got this:</p>
  
  <pre><code>&lt;ServiceRs&gt;
  1
  &lt;/ServiceRs&gt;
  text text text
  &lt;ServiceRs&gt;
  2
  &lt;/ServiceRs&gt;
  </code></pre>
  
  <p>I know, that i can modify pattern - (\n|.)* -> (\n|.){0, n), but  i really don't know how many lines will be in xml.</p>