title: Simplify regular expression for time literals (like "10h50m")
body: <p>I am writing lexer rules for a custom description language using <a href="https://github.com/sebastianriese/pyLR1">pyLR1</a> which shall include time literals like for example:</p>
  
  <pre><code>10h30m     # meaning 10 hours + 30 minutes
  5m30s      # meaning 5 minutes + 30 seconds
  10h20m15s  # meaning 10 hours + 20 minutes + 15 seconds
  15.6s      # meaning 15.6 seconds
  </code></pre>
  
  <p>The order of specification for hour, minute and second parts shall be fixed to <code>h</code>, <code>m</code>, <code>s</code>. To specify this in detail, I want the following valid combinations <code>hms</code>, <code>hm</code>, <code>h</code>, <code>ms</code>, <code>m</code> and <code>s</code> (with numbers between the different segments of course).
  As a bonus the regex should check for decimal (i.e. non-natural) numbers in the segments and only allow these in the segment with least  significance. </p>
  
  <p>So I have for all but the last group a number match like:</p>
  
  <pre><code>([0-9]+)
  </code></pre>
  
  <p>And for the last group even:</p>
  
  <pre><code>([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)  # to allow for .5 and 0.5 and 5.0 and 5
  </code></pre>
  
  <p>Going through all the combinations of h, m and s a cute little python script gives me the following regex:</p>
  
  <pre><code>(([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)h|([0-9]+)h([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)m|([0-9]+)h([0-9]+)m([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)s|([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)m|([0-9]+)m([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)s|([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)s) 
  </code></pre>
  
  <p>Obviously, this is a little bit of horror expression. Is there any way to simplify this? The answer must work with pythons <code>re</code> module and I will also accept answers which do not work with <code>pyLR1</code> if its due to its restricted subset of regular expressions.</p>