Capture the domain till the ending characters $, \\?, /, :. I need a regex that captures domian.com in all of these.
$, \\?, /, :
domian.com
domain.com:3000 do
I'm using Node ^10 and this is how I extract the hostname from a URL.
^10
var url = URL.parse('https://stackoverflow.com/q/13506460/2535178') console.log(url.hostname) //=> stackoverflow.com