But good lord, excluding 26 specific strings? As I said in a parallel thread, it may help to step back and explain in English what the ultimate goal is.
I'm sorry, I missed when you asked that in another thread! I didn't intentionally ignore it, I apologize for that.
In this particular case, I'm using Apache and matching the first section in REQUEST_URI, but want to exclude any real or virtual directory in the account. There are 21 real and 5 virtual directories.
For example, I have a directory named "foo", and have "bar" rewritten to it. I know that I could use -d to test for "foo", but I'd still have to exclude "bar" manually. And I thought that -d might be slower to process than manually adding "foo" to the regex that already has to exist for "bar", but I'm not sure.
So if the user goes to
www.example.com/blerg/, I need to check whether "blerg" exists. If not, I take "blerg" and send it somewhere else. (Note, I know that I would need to have the ^/ in the match, too; I left it out for the sake of making the post easier to read)
But I've run across this issue in the past, too, so I was trying to be a little more generic for the sake of my own education.
I don't know if you're allowed to use lookaheads
It's my understanding that Apache uses PCRE, so I tested it in Perl. I had to wrap [A-Za-z] in ( ), too, and then it worked perfectly! :-D Thanks @lucy24, I still struggle with understanding lookaheads and lookbehinds.