I want to match all strings ending in \".htm\" unless it ends in \"foo.htm\". I\'m generally decent with regular expressions, but negative lookaheads have me stumped. Why
You could emulate the negative lookbehind with something like /(.|..|.*[^f]..|.*f[^o].|.*fo[^o])\.htm$/, but a programmatic approach would be better.
/(.|..|.*[^f]..|.*f[^o].|.*fo[^o])\.htm$/