Already have a working regexp ^[a-zA-Z0-9 ]{1,11}$ but recently got an update in validation: there should be all old validations and new one symbol _ which should appear in whole string exactly once.
Strings must only match:
_name
name_
name_name
validation should fail for:
_name_
__name
etc.
tried a few approaches ^[a-zA-Z0-9_ ]{1,11}$ all characters may be _
^(?)[a-zA-Z0-9 ]{1,11}(?)$ validates
alpha_
_alpha
_alpha_ (shouldn't be valid)
but not this one:
alpha_name