title: PAC - JavaScript - shExpMatch() vs dnsDomainIs()
body: <p>What is the difference between <code>shExpMatch()</code> and <code>dnsDomainIs()</code></p>
  
  <p>The definition says:</p>
  
  <pre><code>// dnsDomainIs()
  // Evaluates hostnames and returns true if hostnames match. Used mainly to match and exception individual host names.
  
  // Example:
  if (dnsDomainIs(host, ".google.com")) return "DIRECT";
  
  
  
  // shExpMatch()
  // Attempts to match hostname or URL to a specified shell expression and returns true if matched.
  
  // Example:
  if (shExpMatch(url, "*vpn.domain.com*") ||
        shExpMatch(url, "*abcdomain.com/folder/*"))
    return "DIRECT";
  </code></pre>
  
  <p>If I understand it correct then</p>
  
  <p><code>shExpMatch()</code> - can use some wildcards</p>
  
  <p><code>dnsDomainIs()</code> - can use exact names</p>
  
  <p>Is <code>shExpMatch()</code> just superior to <code>dnsDomainIs()</code> </p>