in reply to A single regex

With the maximum-of-one-underscore constraint:
/^[a-z0-9]*(?:[a-z][a-z0-9]*_?|_[a-z0-9]*[a-z])[a-z0-9]*$/i
It's either going to have a letter before an (optional) underscore, or it's going to have an underscore before a letter. Surrounding and intervening characters can be letters or numbers.

A lookahead solution would check that there's no more than one optional underscore, and that there's at least one letter:

/^(?=[^_]*_?[^_]*$)\w*[a-z]\w*$/i;
In both cases, you're kind of doing multiple regexes.

Caution: Contents may have been coded under pressure.