title: How to exclude validation for blank space
body: <p>I have the following regular expression in my code to validate a textbox. The expression validates a certain format of text. However, I want the case where the user leaves the textbox blank to also be valid. This regex doesn't match when I submit form with blank text box. I want to remove this case. How do I do that?</p>
  
  <pre><code>^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$
  </code></pre>