regex match where string doesn't occur

12 Views Asked by At

Given the following test set, I want the 1st and 4th line to match:

/src/main.ts
/node_modules/vue-runtime-helpers
/node_modules/.pnpm/[email protected]/node_modules/vue-runtime-helpers/dist/normalize-component.mjs
/node_modules/.pnpm/[email protected]/node_modules/tslib/tslib.es6.js

Usually a regex like this would suffice: /node_modules\/(?!vue-runtime-helpers)/, but this still matches the 3rd line.

What regex do I need to exclude lines 1-3?

0

There are 0 best solutions below