src/vs/platform/extensionManagement/common/configRemotes.ts/getDomainsOfRemotes
export function getDomainsOfRemotes(text: string, allowedDomains: readonly string[]): string[] {
	const domains = new Set<string>();
	let match: RegExpExecArray | null;
	while (match = RemoteMatcher.exec(text)) {
		const domain = extractDomain(match[1]);
		if (domain) {
			domains.add(domain);
		}
	}

	const allowedDomainsSet = new Set(allowedDomains);
	return Array.from(domains)
		.map(key => allowedDomainsSet.has(key) ? key : key.replace(AnyButDot, 'a'));
}