I’d like to devise a regex expression that allows alphanumeric characters, as well as other characters as long as they’re not in the first position. Examples:
VALID: Test
VALID: Hello123
VALID: 456 Hi
VALID: 456-789
VALID: Hi-777
VALID: 333-Hi
VALID: Hello-There
VALID: What's Up
VALID: Hello#Goodbye
INVALID: -Hello
INVALID: &Goodbye
Here’s my starting point, which only allows alphanumeric:
/[a-zA-Z]+/
Use
^[A-Za-z0-9]to require an alphnum character in the first position (immediately following^, the start of the string), followed by whatever else you need.