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) such that getPath(“http://host:8081/path/to/something”) returns “/path/to/something”
Can this be done using regular expressions?