Regular Expressions, REGEX or REGEXP for short, is a special text string for describing a search pattern. Within Hotjar, you can define a Regular Expression to target a specific string or pattern in all tools except for Forms. When setting up a tool in Hotjar, you will be presented with a "Page Targeting" or "Targeting" option in which you can select Regular Expressions as your option. Below is an example of setting up a Heatmap and selecting Regular Expression.
Need help building your Regular Expressions?
Using Regular Expressions in Hotjar
Here are some common Regular Expressions to help you get started. If you're unfamiliar with Regular Expressions, we highly recommend taking a quick crash course here!
Wildcard examples (where * can be anything)
Wildcard excluding a certain pattern
All pages which match the pattern but do not include the word "article" or "post" www.example.com/pages/*/subpage/
Excluding certain words or patterns in a URL
All pages which do not include "/somepage" and "/someotherpage"
Pages which include the word "page" and do not include "somepage":
Multiple pages which don't follow any pattern
Target these three pages:
Looking for information on blocking IPs using Regular Expressions? Check out this article here!