title: Python extract pattern matches
body: <p>I am trying to use a regular expression to extract words inside of a pattern.</p>
  <p>I have some string that looks like this</p>
  <pre class="lang-none prettyprint-override"><code>someline abc
  someother line
  name my_user_name is valid
  some more lines
  </code></pre>
  <p>I want to extract the word <code>my_user_name</code>. I do something like</p>
  <pre><code>import re
  s = #that big string
  p = re.compile(&quot;name .* is valid&quot;, re.flags)
  p.match(s)  # this gives me &lt;_sre.SRE_Match object at 0x026B6838&gt;
  </code></pre>
  <p>How do I extract <code>my_user_name</code> now?</p>