The userinfo a URL carries, exactly as written — ["alice:pa#ss"] for
https://alice:pa#ss@host — or [] when it carries none. Only a value that starts
with a scheme counts (^[A-Za-z][A-Za-z0-9+.-]*://, or a special one such as http: with
any slashes or backslashes after it, as WHATWG reads http:///alice:pw@host and
http:alice:pw@host): a bare a:b@c is a file name (-o run:2026-10-09@x.json), a search
text or a User-Agent as often as a credential, and the base URL always has a scheme. It works
on URLs that don't parse too: the userinfo is everything between the scheme's slashes and the
last @ before the host. Used to redact those exact strings from text that echoes the value
(usage errors, help), whatever characters the password contains.
The userinfo a URL carries, exactly as written —
["alice:pa#ss"]forhttps://alice:pa#ss@host— or[]when it carries none. Only a value that starts with a scheme counts (^[A-Za-z][A-Za-z0-9+.-]*://, or a special one such ashttp:with any slashes or backslashes after it, as WHATWG readshttp:///alice:pw@hostandhttp:alice:pw@host): a barea:b@cis a file name (-o run:2026-10-09@x.json), a search text or a User-Agent as often as a credential, and the base URL always has a scheme. It works on URLs that don't parse too: the userinfo is everything between the scheme's slashes and the last@before the host. Used to redact those exact strings from text that echoes the value (usage errors, help), whatever characters the password contains.