Hi. I want to match a string with a regexp patter similar to:
Basically, it would match anything except 'XfooX' and 'XbarX'.
The closest pattern I can come up with is '/X[^(foo|bar)]X/'.
This, however, doesn't work because ()'s lose their "special powers" within 's. Is there any simple way to do this? And if there's no simple way, what would be the complex way?
EDIT: Wait a minute... I guess I actually posted incorrectly. Sorry about that... I would want it to match strings such as 'XasdfX' and 'XffffffffffffffffX' and 'XzxbcvasdfaX'. I just don't want it to match the string if it has 'foo' or 'bar' in the middle of the X's. In fact, I would also like it to match 'foo XasdfX bar'.