title: melt a data.table with a column pattern
body: <p>I have a <code>data.table</code> that looks like this:</p>
  
  <pre><code>id A1g_hi A2g_hi A3g_hi A4g_hi
  1  2      3      4      5
  ...
  </code></pre>
  
  <p>I would like to <code>melt</code> this table so that it looks like this:</p>
  
  <pre><code>id time hi
  1  1    2
  1  2    3
  1  3    4
  1  4    5
  ...
  </code></pre>
  
  <p>I attempted something like this:</p>
  
  <pre><code>melt(dtb, measure.vars = patterns("^A"), value.name = "hi", variable.name="time")
  </code></pre>
  
  <p>which does not give me what I would like. Do I need to resort to string splitting here or are there native <code>data.table</code> functions that do this?</p>