Regular Expressions for Google Analytics Part II: Dots

Regular Expressions Part II: Dots


regular-expressionsThis is part II of my journey into Regular Expressions for Google Analytics, whereby I am learning them (they are abbreviated as RegEx, or maybe in the plural, RegExen) and teaching them at the same time. I have rewritten this old post to include only the dot, like the one at the end of this sentence. This is to make the post easier and create building blocks for future posts.

Google Analytics says this about dots:

. matches any one character

This is exactly what they mean, but it is so out of context, I couldn’t wrap my head around it. (Match any one character that comes from where? I asked myself…)

They mean that you can create a RegEx like this


and it will match hate, fate, sate, or any four character expression. For that matter, it will match 8ate (there were no rules saying that the character has to be a letter.) It won’t match just ate, because it wants one character to substitute for the dot.

This is why we don’t (usually) ask Google Analytics to match a regular expression that looks like this:

because the dot is a wild card that stands for any one character (right?), so this will also match homepagescom and homepage4com and homepagedcom. Instead, we need to use a backslash to turn the Regular Expression dot into a Plain Old dot. (This is a good time to read Regular Expressions Part I, backslashes, if you haven’t already.) Anyway, we would express it like this:

And that’s why you see backslashes and dots together so often.
Dots .
Carats ^
Dollars signs $
Question marks ?
Pipes |
Parentheses ()
Square brackets []and dashes –
Plus signs +
Stars *
Regular Expressions for Google Analytics: Now let’s Practice
Bad Greed
RegEx and Good Greed
Minimal Matching


Our owner and CEO, Robbin Steif, started LunaMetrics twelve years ago. She is a graduate of Harvard College and the Harvard Business School, and has served on the Board of Directors for the Digital Analytics Association. Robbin is a winner of a BusinessWomen First award, as well as a recent Diamond Award for business leadership. You should read her letter before you decide to work with us.

  • LunaMetrics Blog

    After I rewrote this post, I had to remove all the comments because they were so out of context and thereby confusing. Sorry – Robbin

Contact Us.


24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us



We'll get back to you
in ONE business day.