title: Regex to validate email address to pass Amazon validation
body: <p>I have looked through questions asked in Stack Overflow to answer my question, but haven’t come up with a solution. I am needing to validate email addresses with the Amazon email service validation in mind. Here are the rules I am trying to follow:</p>
  
  <ol>
  <li>Dash cannot be preceded or followed by a period. Example: <code>.-</code> or <code>-.</code></li>
  <li>Dash cannot be at the beginning of the domain. Example: <code>grant.fox@-abcfinancial.com</code></li>
  <li>Dash cannot be at the end of the domain. Example: <code>grant.hill@abc.com-</code></li>
  </ol>
  
  <p>So far this is what I have come up with:</p>
  
  <pre><code>/^[a-z0-9!#$%&amp;'*+=?^_`{|}~-]+(?:.[a-z0-9!#$%&amp;'*+=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9]))+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.[A-Z]{2,6}$/
  </code></pre>