Can anyone help me with this regex I can't get the regex to match. I'm trying to remove the phrases that match from the string
let url = 'en-gb/products/product-category/186/product-type/2';
let word = "product-category";
let regex = new RegExp("\/" + word + "\/\d+", "g");
let output = url.replace(regex, '');
//desired output = 'en-gb/products/product-type/2'
console.log(output);