The PAC convention used by the major web browsers, including Web engine, is to use a modified regular expression syntax. Until now, pacmanager has used ordinary regular expressions for the matching. We are changing the shExpMatch function to use a matching that is similar to the browsers.

This change means that RoomOS will work with the same PAC file matches as other web clients in the network. PAC files specifically written for RoomOS may need to be updated to keep working as intended.

The PAC file evaluation is done in two separate places in RoomOS software:

  • Web engine for its own traffic.

  • Pacmanager for all other HTTP traffic: HttpFeedback, Webex provisioning, call signaling, and so on.

A PAC file can make use of this function: shExpMatch(string, pattern)

It returns true if the string matches the pattern, false otherwise.

The main differences between the two conventions are listed below, with "REGEX" meaning traditional regular expressions and "BROWSER" meaning the web browser convention.

The dot sign, "."

  • REGEX: . matches a single character, which can be repeated with a quantifier

  • BROWSER: . only matches a literal dot character

The star, "*":

  • REGEX: * is a zero-or-more quantifier after an item, but does not match anything on its own

  • BROWSER: * matches zero or more characters

The question mark, "?":

  • REGEX: ? is a zero-or-one quantifier after an item, or can modify the * quantifier to be non-greedy, but does not match anything on its own

  • BROWSER: ? matches a single character

Whether the entire expression must match:

  • REGEX: Without the use of leading ^ and trailing $, the PATTERN does not need to match the entire STRING: It is enough that the STRING contains a substring which matches.

  • BROWSER: Always require STRING to be matched exactly by PATTERN

Examples

We want to match all hostnames under "provider.domain", but not "otherprovider.domain", "provider.domain.tld", or "providersdomain":

REGEX:


     shExpMatch(url, "^.*\\.provider\\.domain$") 
   

BROWSER:


     shExpMatch(url, "*.provider.domain") 
   

We want to match "proxy1.domain", "proxy2.domain", and so on, but not "proxytest.domain":

REGEX:


     shExpMatch(url, "^proxy.\\.domain$") 
   

BROWSER:


     shExpMatch(url, "proxy?.domain") 
   

Other resources

For more details on the PAC file format, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file .