title: How to take middle content between two strings?
body: <p>I need to take a middle content between two string separators, the fact is that I have three printed separators in the whole string, I need to take the second separator and get its middle content towards the last separator. </p>
  
  <p>This is the example:</p>
  
  <pre><code>'__SEPARATOR__'\r\nVMlinux2@ubuntu:~$ ifconfig &amp;&amp; echo '__SEPARATOR__'\r\nens33: flags=4163&lt;UP, 'BROADCAST', 'RUNNING', 'MULTICAST&gt;  mtu 1500inet 10.10.10.11  netmask 255.255.240.0  broadcast 10.10.10.255 __SEPARATOR__
  </code></pre>
  
  <p>The correct output must be:</p>
  
  <pre><code>\r\nens33: flags=4163&lt;UP, 'BROADCAST', 'RUNNING', 'MULTICAST&gt;  mtu 1500inet 10.10.10.11  netmask 255.255.240.0  broadcast 10.10.10.255 
  </code></pre>
  
  <p>I tried with this regex but doesn't work:</p>
  
  <pre><code>'__SEPARATOR__'.*?'__SEPARATOR__'((.|\r|\n|\r\n|\n\r)*)__SEPARATOR__
  </code></pre>
  
  <p>My function:</p>
  
  <pre><code>def get_cmd_output(output):
    regex = r"'__SEPARATOR__'.*?'__SEPARATOR__'((.|\r|\n|\r\n|\n\r)*)__SEPARATOR__"
    output = re.search(regex, output).group(1)
    return output
  </code></pre>
  
  <p>What I'm doing wrong? </p>
  
  <p>Regards.</p>