I have to write a script in perl which parses uris from html. Anyway, the real problem is how to resolve relative uris.

I have base URI (base href in html) for example http://a/b/c/d;p?q (let's go through [rfc3986](https://www.rfc-editor.org/rfc/rfc3986#section-5.4.1)) and different other URIs:

/g, //g, ///g, ////g, h//g, g////h, h///g:f

In this RFC, section 5.4.1 (link above) there is only example of //g:

"//g" = "http://g"

What about all other cases? As far as I understood from [rfc 3986, section 3.3](https://www.rfc-editor.org/rfc/rfc3986#section-3.3), multiple slashes are allowed. So, is following resolution
correct?

"///g" = "http://a/b/c///g"

Or what is should be? Does anyone can explain it better and prove it with not obsoleted rfc or documentation?

**Update #1**:
Try to look at this working url - https:///stackoverflow.com////////a/////10161264/////6618577

What's going on here?