title: I need a Java regular expression
body: <p>I am currently using the following regular expression:</p>
  
  <pre><code>^[a-zA-Z]{0,}(\\*?)?[a-zA-Z0-9]{0,}
  </code></pre>
  
  <p>to check a string to start with an alpha character and end with alphanumeric characters and have an asterisk(*) anywhere in the string but only a maximum of one time. The problem here is that if the given string still passes if it starts with a number but doesn't have an *, which should fail. How can I rework the regex to fail this case?</p>
  
  <p>ex.</p>
  
  <pre>
  TE - pass
  
  *TE - pass
  
  TE* - pass
  
  T*E - pass
  
  *9TE - pass
  
  *TE* - fail (multiple asterisk)
  
  9E - fail (starts with number)
  </pre>
  
  <p>EDIT:
  Sorry to introduce a late edit but I also need to ensure that the string is 8 characters or less, can I include that in the regex as well? Or should I just check the string length after the regex validation?</p>