title: Python re.match only matches before the first \n
body: <p>I'm trying to wrap ping with Python (3.7.4) using <code>subprocess</code> and <code>re</code>.</p>
  
  <p>The <code>stdout</code> from the <code>subprocess</code> function is bytes array so I had to change the regex type to match the case.</p>
  
  <pre class="lang-py prettyprint-override"><code>    import subprocess,re
  
      out = subprocess.run(['ping', '-c', '1', '8.8.8.8'], capture_output=True)
      print(out.stdout)
      match = re.match(br'P(..)G', out.stdout, re.DOTALL | re.MULTILINE)
      if match:
          print(match.groups())
  
      match = re.match(br'trans(.)', out.stdout, re.DOTALL | re.MULTILINE)
      if match:
          print(match.groups())
  </code></pre>
  
  <p>The actual output from the <code>ping</code> command:</p>
  
  <p><code>b'PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n64 bytes from 8.8.8.8: icmp_seq=1 ttl=53 time=60.7 ms\n\n--- 8.8.8.8 ping statistics ---\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\nrtt min/avg/max/mdev = 60.665/60.665/60.665/0.000 ms\n'</code></p>
  
  <p>The first output of <code>match.groups</code>:</p>
  
  <pre><code>(b'IN',)
  </code></pre>
  
  <p>The second one is empty (should be <code>(b'm',)</code>), in fact, everything after the first <code>\n</code> cannot be matched.</p>
  
  <p>Notice I have <code>re.MULTILINE</code>, converting to <code>str</code> using <code>str()</code> or <code>.decode()</code> didn't have any effect on the output.</p>
  
  <p>Checked with several different online tools, they all worked, any ideas?</p>