title: Regex according before text (subdomain + domain + ext)
body: <p>I want to validate these strings</p>
  
  <pre><code>dkfi.fr
  dje_uf.fkeid.fr
  dkei.fkei.fr
  </code></pre>
  
  <p>Because the subdomain can contain underscores but domaine + ext can't.</p>
  
  <p>I have done this regex : </p>
  
  <pre><code>^([0-9a-z\-_\.]+)*(\.[0-9a-z\-]+){2,}$
  </code></pre>
  
  <p>But it doesn't validate dkfi.fr because the point \. after * is required.
  I don't want to put \.? because this wrong string will be accepted : "djeud.kd_dk.fr"</p>
  
  <p>I want the point is not required if the first part (before *) is not validate, so if we are at the begin of string.</p>