title: Java regex for max length with one hyphen
body: <p>I need to validate an input based on given condition,</p>
  
  <p>-must be total length of 20 characters
  -first five position must be alphabets
  -remaining should be numbers but must exists one hyphen(-) which should occur between the numbers only.
  I have the regex like</p>
  
  <pre><code>([a-zA-Z]){5}[0-9]+([-]){15} 
  </code></pre>
  
  <p>but it allows the hyphen at the end as well and even accepts without hyphen.</p>