title: Javascript function to validate time 00:00 with regular expression
body: <p>I am trying to create a javascript function with regular expression to validate and format the time 24 hours, accepting times without semicolon and removing spaces.<br>
  Examples:<br>
  If the user types <code>"0100"</code>, <code>" 100"</code> or <code>"100 "</code> it would be accepted but formatted to <code>"01:00"</code><br>
  If the user types <code>"01:00"</code> it would be accepted, with no need to format.</p>
  
  <p>Thanks.</p>