Try this regular expression:
/^(?:[A-Z\d][A-Z\d_-]{5,10}|[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4})$/i
The expression has two parts:
The first part validates a username. Feel free to optimize this part for matching you own policy. The regex here accepts username starting with a letter or a number. A username can't belonger than 11 characters.
-
and '_' are allowed.The second part validates an email. This regex validates 99% of emails in use as of this writing. However, you may use another email regex.