I want javascript regex for a question mark in url to work I have 3 urls
the requirement is to create a regex for first 2 urls and not the third one.
1st url -- https://www.abc.xyz/search/?collection=check&query=activity
2nd url-- https://www.abc.xyz/search?collection=check&query=activity
3rd url -- https://abc.xyz/searchapps/?query=activity
(/\/search\//.test(window.location.pathname))
works for 1st but not for 2nd
if I use (/\/search?/.test(window.location.pathname)
it works for 2nd url However the problem is it also matches 3rd url https://abc.xyz/searchapps/?query=activity