title: non-capturing version of regular parentheses Python
body: <p>My goals is to locate IP address inside a text.</p>
  
  <p>Using grep, I was able to do it with the regular expression <code>([0-9]+\.){3}[0-9]+</code>.</p>
  
  <p>With <code>re</code> from Python, I don't understand why it doesn't work unless I precede the expression inside the parentheses with <code>?:</code></p>
  
  <p>I understand that the use of <code>?:</code> will prevent the creation of a group, but I can't explain the result when this prefix is deleted.</p>
  
  <pre><code>&gt;&gt;&gt; s
  '64 bytes from 10.11.1.5: icmp_seq=2 ttl=128 time=215 ms'
  &gt;&gt;&gt; p=re.compile(r"(?:[0-9]+\.){3}")
  &gt;&gt;&gt; p.findall(s)
  ['10.11.1.']
  &gt;&gt;&gt; p=re.compile(r"([0-9]+\.){3}")
  &gt;&gt;&gt; p.findall(s)
  ['1.']
  </code></pre>