Surprisingly short regex that matches valid JavaScript identifier names and captures it in a group according common JavaScript naming conventions, e.g:
myVariable
generic name for most identifiers, uses camelCase
MyClass
class names or names of other template-like items, uses UpperCamelCase or PascalCase
REGEX_101
global, user-defined (semantically) constant names, uses CAPS_CASE
101Regex
doesn't match at all, JS names can't start with number
... etc. (see unit tests for more defs)