title: Regular expression for x number of digits and only one hyphen?
body: <p>I made the following regex:</p>
  
  <pre><code>(\d{5}|\d-\d{4}|\d{2}-\d{3}|\d{3}-\d{2}|\d{4}-\d)
  </code></pre>
  
  <p>And it seems to work.  That is, it will match a 5 digit number or a 5 digit number with only 1 hyphen in it, but the hyphen can not be the lead or the end.</p>
  
  <p>I would like a similar regex, but for a 25 digit number.  If I use the same tactic as above, the regex will be very long.</p>
  
  <p>Can anyone suggest a simpler regex?</p>
  
  <p>Additional Notes:
  I'm putting this regex into an XML file which is to be consumed by an ASP.NET application.  I don't have access to the .net backend code.  But I suspect they would do something liek this:</p>
  
  <pre><code>Match match = Regex.Match("Something goes here", "my regex", RegexOptions.None);
  </code></pre>