title: RegExp for an identifier
body: <p>I am trying to write a regular expression for an ID which comes in the following formats:</p>
  <p><code>7_b4718152-d9ed-4724-b3fe-e8dc9f12458a</code></p>
  <p><code>b4718152-d9ed-4724-b3fe-e8dc9f12458a</code></p>
  <p><code>[a_][b]-[c]-[d]-[e]-[f]</code></p>
  <ul>
  <li><code>a</code> - optional 0-3 digits followed by an underscore if there's at least
  a digit (if there is underscore is required)</li>
  <li><code>b</code> - 8 alphanumeric characters</li>
  <li><code>c</code> - 4 alphanumeric characters</li>
  <li><code>d</code> - 4 alphanumeric characters</li>
  <li><code>e</code> - 4 alphanumeric characters</li>
  <li><code>f</code> - 12 alphanumeric characters</li>
  </ul>
  <p>I have came up with this regexp but I would appreciate any guidance and/or corrections. I am also not too sure how to handle the optional underscore in the first segment if there are no digits up front.</p>
  <p><code>/([a-zA-Z0-9]{0,3}_[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})+/g</code></p>