Regex get domain name from email
<p>I am learning regex and am having trouble getting <code>google</code> from email address</p>

<p>String</p>

<pre><code>first.name@google.com
</code></pre>

<p>I just want to get google, not google.com</p>

<p>Regex:</p>

<pre><code>[^@].+(?=\.)
</code></pre>

<p>Result: <a href="https://regex101.com/r/wA5eX5/1" rel="noreferrer">https://regex101.com/r/wA5eX5/1</a></p>

<p>From my understanding. It ignore <code>@</code> find a string after that until <code>.</code> (dot) using <code>(?=\.)</code></p>

<p>What did I do wrong?</p>