The Blog

KB #05: Transforming a .pac script into an exclusion list

KB Olfeo Saas
June 9, 2023


Isolate URLs excluded by a .pac script in the form of a list.


In the case of an on-premise to SaaS migration, the administrator needs to import the proxy's flow exclusions. If the exclusions are indicated as a list in a GPO, then he can directly copy and paste this list. But if he uses a .pac script to indicate these exclusions and the proxy through which he must pass, then he must retrieve the excluded URLs via a tedious job of isolation and copy-paste. This KB is designed to facilitate this process, using regular expressions (known as RegEx for "regular expression").


Have a proxy.pac script


Let's take the example of this proxy.pac :

To extract all hostnames in list format with only the hostname, use this RegEx :

/(?<=host\ \=\=\=\ \ »)(.*?)(?=\ »)/gm

To apply it, go to and copy the resulting list directly into the "List" tab in the second half of the screen:

Screenshot from

Finally, to extract all excluded domain names with the dnsDomainIs comparison method, we use this RegEx :

/(?<=dnsDomainIs\(host\,\ »)(.*?)(?=\ »\))/gm

You can use again to apply this RegEx.

You can concatenate the two lists and paste the resulting list in: Configuration > Traffic management > (Edit your .pac) > Content > Multiple editing.


Don't forget to save by clicking on "Validate" then "Save and exit".