I'm working on a regex to validate a form field's input. I've just begun to learn about regular expressions and would like to see if anyone has any feedback.
What I'm trying to do:
- The input can contain multiple words
- Can not contain any symbols other than white space and - (dash)
- I don't want the first character to be a number
- After the first character the string can be alpha-numeric
- My Name
- Another-Name Folks
- 1or The Other
- *Hello Dr. *Jones
- What_is_Going on
Here's what I came up with:
It seems to be working fine, but I'm not sure if there are any shortcuts I may be able to use, or if I'm leaving anything out.