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
Quick 'n' dirty:
^[^#]*?://.*?(/.*)$
Everything after the hostname and port (including the initial /) is captured in the first group.