I need to create a regex for 3 rules.
- The string can start with a letter or
_. No numbers are allowed before the letter or_. - The
_can be added in any place. - Using special characters or spaces is not allowed.
I created 2 regexes(^[A-Za-z0-9_]*$ and ^[^0-9]*$) but don't know how to combine them together. Also, the rules do not include a number at the end(like _Sss12).
_Aaa12 - correct
Aaa - correct
aa aa - fail
12aa - fail
^[A-Za-z_][A-Za-z0-9_]*$.