Welcome to WalkMe support

Please login in order to continue:

Work flows better with WalkMe
Work flows better with WalkMe.

How To Use Regex to Define the Domain(s) Which Inject WalkMe

Last Updated March 6, 2024

General Guidelines

Regex should be as specific as possible, but also general enough to work on different pages. To achieve this balance, use customer-specific prefixes.

The Regex for each environment must be different. Prefixes also come in handy here.

Begin and end every string of regex with .*

  • Example: .**

Instead of using digits, use .*. Replace any numbers in a URL with .*

Make sure to put a \ before every period.

  • Example: .*salesforce\.com.*

No need to escape hyphens.

  • Example:
    • Don't use: .*panasonic\-\-full\.salesforce\.com.*
    • Do use:  .*panasonic--full\.salesforce\.com.*)

To include a URL with two or more different prefixes use (first|second|third|etc.) where the prefixes occur.

For regex to exclude a word, refer to the below example, where you want to create an extension with one editor account on Salesforce Classic and one on Salesforce Console.

  • Example:
    • Salesforce classic regex: .*cs.*!console).*
      • Note: This (?!console) excludes the word console from the regex.
    • Salesforce console regex: .*cs.**

To include more than one regex in a package, place an | in between each regex with no spaces.

  • Example: .*cs.**|.*cs.**

Make sure to never leave two consecutive || in a package, as this will cause a allow list and match to all URLs and introduce errors on certain sites.

Regex is case sensitive. Be sure to match the correct case of the URL within the regex.

Stricter Domain Regex

There may be a scenario where you need to "tighten" the regex to exclude a specific frame. For instance, you may only want WalkMe to inject in a specific iFrame, but that iFrame's domain is included in many other iFrames as a reference.

Example of iFrame domain you want WalkMe to appear in:


Example of iFrame domain that we are trying to prevent WalkMe from injecting into:


To specify that regex that must come at the beginning of the URL, we use:

  • ^https?://[^/]*(visual.force).com

Using, this WalkMe will only inject into the iFrame if its the first part of the URL.

Platform-Specific Regex Tips

There are a number of extensions we are often asked to configure that are standard.


It is extremely important to build Salesforce extensions carefully and to test them in a number of test scenarios due to the variance in the platform across pages and the presence of many analytics iFrames that take up 0px.

Creating the extension

  • Use negative look-ahead regex to avoid the session server and other unnecessary injections: (?!/(login/sessionserver|s.gif)
  • Using "Or" logic within the package is more efficient than creating two separate extensions
  • "na" can be sometimes "ap," "eu," or "cs" depending on the Salesforce server geographic location, but it generally doesn't change, so stick with the URL you have
    • nameansNorthAmerica,apmeansAsia-Pacific,andeumeansEurope, Middle East or Africa.csrepresents a sandbox environment
    • The number next to the 2-letter code indicates the server instance in the assigned country. This can change when uploading a new environment or refreshing an existing one
    • You can see the Salesforce servers' health status at

Testing the extension

  • Ask the CSM to provide a "heavy" page with lots of content or alternatively, an important page in the implementation and make sure it works well there
  • Verify the extension isn't injecting into too many iFrames using the Master Extension Diagnostics Tool

When building/testing in Salesforce Lightning, use a new extension without the "walkme_" component; for example, walkmecs will work and not walkme_cs will not.


Website  Example URLs  Suggested Regex
Salesforce Classic
Salesforce Lightning  .*cs.**
Salesforce Console  .*cs.**


Website  Example URLs  Suggested Regex
Salesforce Classic
Salesforce Lightning  .*na.**
Salesforce Console  .*na.**

In the above examples, you'll notice we added (?!console) to the Salesforce Classic regex. Since these packages are within the same extension and the Classic and Console URLs are fairly similar, we don't want WalkMe to get confused and load WalkMe where it shouldn't load (or not load at all!). The only difference between one of the Classic and Console URLs is that the Console URL has "/console" at the end. So, we add the (?!console) to the Salesforce Classic regex to ensure it does not load any content meant for Salesforce Console.



 Example URL  Suggested Regex  .**


 Example URL  Suggested Regex  .**



 Example URL  Suggested Regex .*hcm.**


 Example URL  Suggested Regex .*performancemanager.**

SuccessFactors URLs don't have a constant pattern. Production and test can be practically identical, for example:
If that's the case, use different extensions with the same regex.

Distinguishing between similar but critically differentiated URLs

In configuring an extension, you will often need multiple packages for different platforms, for example, one for normal Salesforce (SFDC) and another for Service Cloud. In such cases, your browser extension will utilize regex to differentiate between platforms and inject different snippets into these different platforms as appropriate. In the SFDC Service Cloud hypothetical, we could use regex to differentiate between these platforms as follows:

Normal SFDC URL:

Normal Service Cloud URL:

Regex statement for the extension to capture any Service Cloud URL:

  • .**

This hones in on the appearance of the term "console" immediately after the domain.

Because a clear difference between the Service Cloud URL and the SFDC URL is the appearance of the word "console" immediately after "", we can use this to our advantage.

Using the regex symbols "?!", we can single out all instances of "" that are not followed by the word "console", and, given our two base URLs, we know these will be SFDC URLs.

SFDC regex:

  • .*!console).*

Here, "?!console" means any URL possessing the items in this regex, where "console" does NOT appear in this position in the expression.

This will not match, but it will match

Was this article helpful?

Thanks for your feedback!

Be part of something bigger.

Engage with peers, ask questions, share ideas

Ask the Community
The trademarks and product names of Workday, Inc., including the WORKDAY® mark, are the property of Workday, Inc. WalkMe is not affiliated with Workday, Inc., nor does Workday, Inc. sponsor or endorse WalkMe, its services or its website.