How to configure trusted patterns for localhost:8082/d8multisite.com?
The trusted_host_patterns settings is only for the domain name used to access the site. The regular expression you use must not include neither the port used to access the site, nor any path. If you access the site using as localhost, then the setting you should use is the following one.
$settings['trusted_host_patterns'] = array(
  '^localhost$',
);

If the site is accessible either as localhost or d8multisite.com, and you want to be able to access the site using both of them, then you should use the following setting.
$settings['trusted_host_patterns'] = array(
  '^localhost$',
  '^d8multisite\.com$',
);

Since the dot has a special meaning in a regular expression (it matches any single character), you need to escape it, so it is considered a normal character. To do so, you need to use . not /..