Regex to allow single hyphen and underscore but not at beginning or end of string
<p>I have this Regex I modified to allow underscores, hyphen, letters and numbers.
I am trying to modify it further so that it has the following properties:</p>

<ol>
<li>Allow only Numbers, Letters</li>
<li>Allow Underscore or Hyphen anywhere between the first and last character </li>
<li><p><strong>Cannot</strong> start with <strong><em>underscore</em></strong> or <strong><em>hyphen</em></strong> <em>(only between first and last character).</em></p>

<p>"^[a-zA-Z0-9_-]*$"</p></li>
</ol>

<p>Thank for your help.</p>
