Regex for username
Posted on 2007-11-29
need a pretty simple regex but my head is a bit fuzzy and can't get it working quite right...
what i need is a regex for a user name that accepts a-z, A-Z, 0-9, -, and _ but DOES NOT allow - or _ at the beginning or the end.
I have the first part: /^[a-zA-Z0-9_-]+$/
please help me add the -/_ restriction... thanks!