Is there a way to prevent certain words or phrases from being used in usernames?
You could try the title blacklist extension.
And words entered into that would be prevented from being used in usernames at all, not just in the exact form?
So if I set idiot (or Idiot) from being used in a username, it would prevent the creation of usernames Idiot, uridiot, adminisidiotxx, or Big Idiot?
I saw in the extension page that you can use a file in the wiki to have the list of prohibited words, instead of a MediaWiki page? Is that possible? I would prefer that a list of prohibited words not be publicly accessible for obvious reasons.
I require users to confirm email before being allowed to edit, as a way of preventing spammers from editing. I'm currently under attack from a troll who uses account names as a way of posting obscenities and outing other users when I'm online at the same time as him, and he doesn't have time to confirm his email and spam the wiki before I ban him. I've set a maximum length for usernames, but apparently it's long enough for him to have his way. I've had to disable account creation twice because of him, and it's still disabled until I can figure out a way of dramatically reducing his ability for trolling.
The list must be on the mediawiki page to work, unfortunately. The usernames that the regex blocks depends on the regex you use. A great page with regex help is here.
How do I control the regex I use? After looking at the Wikipedia article, I'm guessing it's consecutive regex, the first example.
The list does not need to be on a MediaWiki page. The extension page mentions how to use a file instead.
How do I create the regex that I want to use?
I'm not an expert at Regex, but I'd assume User:[A-Za-z0-9_]*[Ii]diot[A-Za-z0-9_]* would work? Where are the RegEx experts? Or would User:[\x21-\x7E]*[Ii]diot[\x21-\x7E]* be better? Please await expert advice. Those were suggestions.
It doesn't have to be so complex. wikipedia:mediawiki:titleblacklist has a variety of examples, the simplest of which are pretty much self-explanatory. Take particular note of how to prevent account creation.