My URL is like :
https://www.example.com?vid=123124321524
I will have to replace vid value with "--notavailable--" So it should be:
https://www.example.com?vid=--notavailable--
I will have to use JS .replace() function(I have to use Regex).
There might be multiple params, should be exact param(XXXvid should NOT match)
Basically i have to pass solution to array like: ["regex","new param value"]
For example
"https://www.example.com?vid=123124321524".replace(/[?|&]vid=\K([^&#]*)/,"--notavailable--")
Why is not working? EDIT: I realised it work with php not JS
I have tried lots of thing, still no luck. Thanks!