Escaping of `\` within character classes should be made consistent here. I recommend whichever gzips smaller between them (probably the first):
* `/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/`
* `/^([\w.+-]+:)(?:\/\/(?:[^/?#]*@|)([^/?#:]*)(?::(\d+)|)|)/`