From the course: Advanced Google Analytics

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Regular expressions (regex)

Regular expressions (regex)

- [Instructor] As you go to create your filters, it's very common that you'll need to use regular expressions to really get them to do what you them to do. And regular expressions are most commonly referred to as regex, and this is a language that is used to describe a search pattern. It allows you to use essentially very powerful wildcards. Let's say, for example, that our office had the following IP address range, and we wanted to exclude this range from ever capturing data in Google Analytics. We would write regex, which would look like this. And here's how this breaks down. When we see the slash, this means that the character that comes after that slash needs to be interpreted literally. You see, the period is actually a regular expression for matching any single character. So if we simply left the dots in the IP address, then the regex would use that to match any other character. So we have to use that preceding…

Contents