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
/^((?:[a-z0-9-_]+\.)*[a-z0-9-_]+\.?)(?::([0-9]+))?(.*)$/i
matches are host, port, path