I have urls and want to match only those which match this pattern
^/zxp/companies/.*?/queries/.*?$
but not contains this type=inbox - so for example - regexp should give following results:
"/zxp/companies/432523/queries/4344?read=2&type=inbox" -> FALSE
"/zxp/companies/432523/queries/4344?type=inbox&read=2" -> FALSE
"/zxp/companies/432523/queries/4344?type=query&read=2" -> TRUE
"/zxp/companies/432523/queries/4344" -> TRUE
"/zxp/companies/432523/buildings/4344?type=query&read=2" -> FALSE
"/zxp/companies/432523/buildings/4344" -> FALSE
I try this but get wrong results (good only when type=inbox is at the end of string)
let re = /^\/zxp\/companies\/.+?\/queries\/.*(?<!type=inbox)$/
let tests = [
"/zxp/companies/432523/queries/4344?read=2&type=inbox",
"/zxp/companies/432523/queries/4344?type=inbox&read=2",
"/zxp/companies/432523/queries/4344?type=query&read=2",
"/zxp/companies/432523/queries/4344",
"/zxp/companies/432523/buildings/4344?type=query&read=2",
"/zxp/companies/432523/buildings/4344",
]
tests.forEach(t => console.log(`${t} -> ${re.test(t)}`))
How to do it using JavaScript RegExp?

