This regular expression matches an username with the following conditions:
- it is between 8 to 30 characters
- it contains only a through z, A through Z, 0 through 9, and underscore
- it begins with an alphabetic character
/^[a-zA-Z](?!.*[?@!]).{7,29}$/igm
This regular expression matches duplicate words is not case-sensitive.
/\b([a-z]+)\b(\s\1\b)+/igm