Regex for the name should start with a letter

advertisements

I am trying to write a regex for name which starts with a letter and can also have spaces, numbers in the string.

Currently I am using ^(?=.*[a-zA-Z].*)([a-zA-Z0-9' ]{1,50})$.

But it is accepting the string like "1125151asdgvhavdg". i.e., it is taking numbers at the starting.

My string should look like this

ads564564545456 fdsf78


As simple as:

^([a-zA-Z][a-zA-Z0-9' ]{0,49})$

You don't need any assertions here