Hey so I'm looking for a regrex pattern that:
- Allows for only two or one
_in a row but no more, can end start and have the_in between - Max 20, min 3 characters
- Allows for only one period in a row and can't start or end in a period
- Accepts A-Z and 1-9
Some examples of passes and fails are:
.test #fail
_test #pass
_.test #pass
__test #pass
test_ #pass
te_.st #pass
te.st #pass
..test #fail
So far I have ^[\w](?!.*?\.{2})(?!.*?_{2})[\w.]{1,28}$, which works for everything but detecting the __ between and at the end of the words. Any help would be appreciated! This has been hurting my brain for hours