title: PHP regex accepts only letters and numbers and only one dot
body: <p>I don't know much about regex and I'm trying to create a username string accepts only English letters and numbers and only one dot.</p>
  
  <p>I have this regex code:</p>
  
  <pre><code>if(preg_match('/[^A-Za-z0-9]/', $username)){
      $error = "Invalid Username";
  }
  </code></pre>
  
  <p>this code allowed me to have only English letters and number, I want to add dots to this code, and accept only one dot.</p>