I need to write some javascript to strip the hostname:port part from a url, meaning I want to extract the path part only.
i.e. I want to write a function getPath(url
It's very simple:
^\w+:.*?(:)\d*
Trying to find second occurance of ":" followed by number and preceded by http or https.
This works for below two cases
Ex:
http://localhost:8080/myapplication
https://localhost:8080/myapplication
Hope this helps.