title: Javascript conditional regular expression if-then-else
body: <p>I'm trying to limit the entries to a specific format.</p>
  
  <p>If the entry has 5500 or 5100 such as 01\01-5500-000-00 then I want to have this:</p>
  
  <pre><code>^[0-9]{2,}\\[0-9]{2}\-[0-9]{4}\-[0-9]{3}\-$
  </code></pre>
  
  <p>But if the entry has anything other than 5500 or 5100 I want to have this:</p>
  
  <pre><code>^[0-9]{2,}\\[0-9]{2}\-[0-9]{4}\-[0-9]{3}\-[0-9]{2}$
  </code></pre>
  
  <p>How can this be accomplished with the if then else idea?</p>