I'm trying to validate Firebase event name:
Event names can be up to 40 characters long, may only contain alphanumeric characters and underscores ("_"), and must start with an alphabetic character.
Invalid:
4foo(start with a number)foo bar(contains a space)foo$@bar(contains special character)
Valid:
foofoo_barFoo_Bar
I have tried \d?[^A-Za-z0-9_]+ which matches if there are any special characters and whitespace, but it won't match string with a digit character at the beginning.