title: Regex to match a digit two or four times
body: <p>It's a simple question about regular expressions, but I'm not finding the answer.</p>
  
  <p>I want to determine whether a number appears in sequence exactly <strong>two</strong> or <strong>four</strong> times. What syntax can I use?</p>
  
  <p><code>\d{what goes here?}</code></p>
  
  <p>I tried <code>\d{2,4}</code>, but this expression accepts three digits as well.</p>