title: How to verify form input using HTML5 input verification
body: <p>I have tried finding a full list of patterns to use for verifying input via HTML5 form verification for various types, specifically <code>url</code>, <code>email</code>, <code>tel</code> and such, but I couldn't find any. Currently, the built-in versions of these input verifications are far from perfect (and <code>tel</code> doesn't even check if the thing you're entering is a phone number). So I was wondering, which patterns could I use for verifying the user is entering the right format in the inputs?</p>
  
  <p>Here are a few examples of cases where the default verification allows input that is not supposed to be allowed:</p>
  
  <h3><code>type="email"</code></h3>
  
  <p>This field allows emails that have incorrect domains after the @, and it allows addresses to start or end with a dash or period, which isn't allowed either. So, <code>.example-@x</code> is allowed.</p>
  
  <h3><code>type="url"</code></h3>
  
  <p>This input basically allows any input that starts with <code>http://</code> (Chrome) and is followed by anything other than a few special characters such as those that have a function in URLs (\, @, #, ~, etc). In FF, all that's checked is if it starts with <code>http:</code>, followed by anything other than <code>:</code> (even just <code>http:</code> is allowed in FF). IE does the same as FF, except that it doesn't disallow <code>http::</code>.</p>
  
  <p>For example: <code>http://.</code> is allowed in all three. And so is <code>http://,</code>.</p>
  
  <h3><code>type="tel"</code></h3>
  
  <p>There currently is no built-in verification for phone numbers in any of the major browsers (it functions 100% the same as a <code>type="text"</code>, other than telling mobile browsers which kind of keyboard to display.</p>
  
  <hr>
  
  <p>So, since the browsers don't show a consistent behaviour in each of these cases, and since the behaviour they do show is very basic with many false positives, what can I do to verify my HTML forms (still using HTML5 input verification)?</p>
  
  <hr>
  
  <p><em>PS: I'm posting this because I would find it useful to have a complete list of form verification patterns myself, so I figured it might be useful for others too (and of course others can post their solutions too).</em></p>