Use a list of non-Colon characters for the character preceding //the REGEXPR_REPLACE pattern line
This is the same as Littlefoot's solution, except that we do not replace the first with the //previous one :.
We simply point out that we do not want a match for an asymmetric character list [^:], and then encapsulate it in a group of characters (put this in the parenthesis).
\1, .
SCOTT@db>SELECT
2 regexp_replace('https://pet/green//car/plane//garden','([^:])//','\1/') http_url
3 FROM
4 dual;
http_url
------------------------------------
https:
, , Oracle () () lookbehind.
Vim:
\(https:\|http:\)\@<!= lookbehind "https:" "http:"
\/\/=
//,
