I am facing a problem. I want to replace double or additional slashes from the URL with just one slash. But I am doing the wrong way. The requirement is the slashes should be in the middle or end of the url, should not match with the protocol double slashes e.g. `http://` and `https://`. But my regex is also matching these slashes. How can I ignore the protocol slashes?

```js
const example1 = `https://example.com/home2`;
const example2 = `http://example.com/home2/`;
const example3 = `http://example.com//home2///`;
const example4 = `http://example.com/////home2///`;
const example5 = `http://example.com/////home2///heloo//////`;
const example6 = `http://example.com////home2/////////////`;
const example7 = `https://example.com////home2/////////////`;
const example8 = `http://localhost:9000/////`;

const patt = /\/\/+/g;

const res1 = patt.test(example1) ? example1.replace(patt, '/') : example1;
const res2 = patt.test(example2) ? example2.replace(patt, '/') : example2;
const res3 = patt.test(example3) ? example3.replace(patt, '/') : example3;
const res4 = patt.test(example4) ? example4.replace(patt, '/') : example4;
const res5 = patt.test(example5) ? example5.replace(patt, '/') : example5;
const res6 = patt.test(example6) ? example6.replace(patt, '/') : example6;
const res7 = patt.test(example7) ? example7.replace(patt, '/') : example7;
const res8 = patt.test(example8) ? example8.replace(patt, '/') : example8;

// The results should be something like this.
console.log(res1); // https://example.com/home2 => https://example.com/home2
console.log(res2); // http://example.com/home2/ => http://example.com/home2/
console.log(res3); // http://example.com//home2/// => http://example.com/home2/
console.log(res4); // http://example.com/////home2/// => http://example.com/home2/
console.log(res5); // http://example.com/////home2///heloo////// => http://example.com/home2/heloo/
console.log(res6); // http://example.com////home2///////////// => http://example.com/home2/
console.log(res7); // https://example.com////home2///////////// => https://example.com/home2/
console.log(res8); // http://localhost:9000///// => http://localhost:9000/
```