title: How to convert time format into milliseconds and back in Python?
body: <p>The reason is because I'm making a script to work with ffmpeg and I need to be able to add/subtract time in the format 00:00:00[.000]</p>
  
  <p>The last 3 digits are optional and they mean milliseconds. A time string could look like any of the following</p>
  
  <pre><code>4:34.234
  5.000
  2:99:34
  4:14
  </code></pre>
  
  <p>This would be easier if a lot of the digits weren't optional. But since they are, I'm thinking I have to use some sort of regex to parse it?</p>