Validation of a field in a REGEX form

Asked

Viewed 26 times

1

Good morning, I have the following problem: I have a regex that validates the following situations: Not containing dots, spaces, accents and/or capital letters " [a-Z0-9]*$" I also wanted to include so that I didn’t allow numbers just as the first character, how could I do this?

1 answer

1


You can mount the regex in two parts, the first one specifying that the first character should be a lower-case letter (^[a-z]+) and the second that the rest can be both numbers and letters.

^[a-z]+[0-9a-z]*$
  • Show, that’s exactly what I needed, thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.