title: regex - conditional check for 2nd digit based on first digit
body: <p>I am looking up for a regular expression that checks the following:</p>
  <ul>
  <li>first digit can be 0 or 1 or 2 [012]</li>
  <li>if the first digit is 0, then second digit should be odd number [1379]</li>
  <li>if the first digit is 1, then second digit should be 5 and 10</li>
  <li>if the first digit is 2, then second digit should be even number [02468]</li>
  </ul>
  <p>I stumbled upon look ahead and look behind.  I could succeed in getting only one condition success, using this expression.</p>
  <pre><code>/[0-2](?&lt;=0)[1379]/
  </code></pre>
  <p>The above checks, if digit is 0, then 2nd digit is odd.</p>
  <p>I am unable to get the other two conditions to match.  Any help?</p>