0

I know that I can negate a specific word with negative lookahead - so in my example how do I negate an actual "/checkout/payment" but accept only when have the word "/checkout/"?

What I need exactly:
/itempage/ - not match
/product/model - not match
/checkout/ - match
/checkout/shipping - match
/checkout/payment - not match

1 Answers1

0

Your question isn't clear enough to get a definite handle on what you want. But in Javascript:

/^\/checkout\/(?!payment)/

This will match /checkout/, /checkout/shipping, /checkout/other, but not /checkout/payment or /checkout/paymentABC.

tremby
  • 9,541
  • 4
  • 55
  • 74