What is the difference between shExpMatch()
and dnsDomainIs()
The definition says:
// 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";
If I understand it correct then
shExpMatch()
- can use some wildcards
dnsDomainIs()
- can use exact names
Is shExpMatch()
just superior to dnsDomainIs()
.
so thatdnsDomainIs("www.notmycompany.com", ".mycompany.com")
returns false. – Hexad