Czar
06/21/2018, 4:17 PMurl.replace("(?<!https?:)//".toRegex(), "/")
I have it as an extension function in relevant module.
But impact is not really noticeable. I haven't run any benchmarks though. And Regex is actually a final val, here it's inlined for brevity.