Validating a field in a REGEX form

1

Good morning, I have the following problem: I have a regex that validates the following situations: Do not contain dot, space, accents and / or capital letters "^ [a-z0-9] * $" I also wanted to include so that I would not allow numbers just as a first character, how could I do this?

    
asked by anonymous 12.01.2018 / 13:45

1 answer

1

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

^[a-z]+[0-9a-z]*$
    
12.01.2018 / 13:52