title: Extract a specific portion of connection string
body: <p>Any way to extract what's after the <code>@</code>(if any) and before the next <code>.</code> (if any)?</p>
  
  <p>Examples:</p>
  
  <pre><code>host
  host.domain.com
  user@host
  first.last@host
  first.last@host.domain.com
  first@host.domain.com
  </code></pre>
  
  <p>I need to get <code>host</code> in a variable.</p>
  
  <p>Suggestions in Python? Any method is welcomed.</p>
  
  <p>Thanks,</p>
  
  <p>EDIT: I fixed my question. Need to match <code>host</code> and <code>host.blah.blah</code> too.</p>