title: Can the domain part of an email address be an IP addresses?
body: <p>I'm trying to build a regular expression to detect a valid email. I've gone through some articles here on Stack Overflow. I've also read the <a href="https://www.rfc-editor.org/rfc/rfc2822#section-3.4.1" rel="nofollow noreferrer">section 3.4.1 of RFC 2822</a>, which describes the different components of an email address:</p>
  <pre><code>addr-spec       =       local-part &quot;@&quot; domain
  
  local-part      =       dot-atom / quoted-string / obs-local-part
  
  domain          =       dot-atom / domain-literal / obs-domain
  
  domain-literal  =       [CFWS] &quot;[&quot; *([FWS] dcontent) [FWS] &quot;]&quot; [CFWS]
  
  dcontent        =       dtext / quoted-pair
  
  dtext           =       NO-WS-CTL /     ; Non white space controls
  
                          %d33-90 /       ; The rest of the US-ASCII
                          %d94-126        ;  characters not including &quot;[&quot;,
                                          ;  &quot;]&quot;, or &quot;\&quot;
  </code></pre>
  <p>In simple English, can someone explain the definition above? Does it allow for an email such as <code>info@[192.168.0.1]</code>?</p>
  <p>I know that I don't have to re-invent the wheel, and that there are good libraries that I can use to validate an email. I just want to understand how things work under the hood.</p>