Regex - has six digits, starts with 0, 1, or 2 <p>I need a regex that will match a number containing six digits. The first digit must be 0, 1, or 2.</p> <p>For example - 054654 or 198098 or 265876.</p> <p>So far I got this: <code>/^\d{6}$/</code> - matches a number containing six digits. How do I add the second requirement: first digit must be 0, 1, or 2?</p>