I have the following JavaScript regular expression. I'm wondering if there is a way to simplify or improve it.
Here's my existing RegExp, which doesn't test for new lines, or the beginning of the string:
/([^0-9a-z+=%$#?!&<>;()@* -,./{}^[]\]+)$/
Here's what I've tried since words are only alphas and underscores, but it says new lines are valid, as are special characters.
/w[^a-z0-9
]+/
I am trying to have words with only uppercase alphas and underscores, with underscores only after an alpha.
Valid input would be:
ERIS_TEST_GROUP_NAME
JENNIFER_AD_GROUP_NAME
PSEUDO_TEST_TEAM
TEST_GROUP
Invalid input would be anything with new lines or special characters, lower case characters, or starting with the underscore:
_JEN_TEST_GROUP
234*((_&&*^
ab^*(_EWRR)
e_RERE_^&)(*$#$#@()\
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…