I've been really struggling with regex lately ... I never quite got the hang of it. I'm currently hung up on trying to match on the following in my .htaccess file:


The catch is that I want the alphanumeric string to NOT be one of a short list of words i.e. (bar|baz|bat)

How can I match on any alphanumeric word as long as it is not in a list?

4 Years
Discussion Span
Last Post by BigPaw

I did some more investigating and was able to get it to work (I think) with lookahead??


It seems to work but can someone confirm that I did it correctly??


On my phone ATM so can't test it out or anything. But in principle, it looks OK to me. Might be worth getting another opinion though. I'm a little rusty with regex's myself! :)


Well, in all honesty I thought you had been banging your head on the keyboard when I first saw it. :D

After seeing this and thinking about it, this is fascinating methodology, and I've begun studying it.

This subject is still way above me so I can't make a conclusive comment here, but I did find this regular expression tester. At the moment I can't see how it works, and it may not be advanced enough for what you are looking for.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.