What you are describing (your intention) is a negative look, and Javascript does not support feedback.
A look ahead is to look at the character on which they are placed ββ and you placed it before . . So what do you actually say βanything ending in .htm if the first three characters starting at that position ( .ht ) are not foo β, which is always true.
Typically, replacing negative back delays should fit more than you need and extract only the part that you really need. These are hacks, and depending on your exact situation, you can probably come up with something else, but something like this:
// Checks that the last 3 characters before the dot are not foo: /(?!foo).{3}\.htm$/i.test("/foo.htm"); // returns false
NicoleC Jul 27 '11 at 22:20 2011-07-27 22:20
source share