118
rated 0 times
[
123]
[
5]
/ answers: 1 / hits: 17163
/ 6 Years ago, wed, february 14, 2018, 12:00:00
I can't figure out javascript regex that would satisfy all those requirements:
The string can only contain underscores and alphanumeric characters.
It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
This is as far as I came, but 'not containing consecutive underscores' part is the hardest to add.
^[a-zA-Z][a-zA-Z0-9_]+[a-zA-Z0-9]$
More From » regex