REGEX TOOL: The Regexinator, A Google Analytics RegEx Include Filter Compiler


If you’ve ever had to string together multiple phrases for a RegEx filter in Google Analytics, you know how much of a pain it can be to assemble. You have to get all the terms, stick them together with pipes, and escape any RegEx characters in the filter. All of this can become very time-consuming, and woe upon you if you have to do this multiple times.

Enter the Regexinator, a Google Analytics regex generator that takes long lists of words or phrases and generates 255 characters snippets of properly formatted RegEx-style terms. Click here and download it now!


How the Regexinator works

First, download the sheet and open it in Excel. Once you’ve opened it, gather the terms you’d like to create filters with and paste them under Terms in Column A. Then enter either “Y” or “N” in the box next to “Exact Match?” if you wish to only see results that match exactly your terms. Your filters will appear under ‘Results’ in Column E – you’ll only be able to use one cell per include filter, since they’re built to be or get as close to being 255 characters, the maximum number Google Analytics allows for RegEx. Not sure how to use more than one include filter? You just create a new custom segment under the Advanced Segments option on Google Analytics.

Why would I ever need this?

I can think of plenty of hypothetical scenarios that this might come in handy – but let me share mine with you. I needed to find the most profitable product for an ecommerce client of ours in Google Analytics. Unfortunately, even though they all shared a category on their search subdomain, they didn’t share a common feature in their URL that I could filter by. Here’s what I mean:

    • Red Hat 1 (
    • Red Shirt 1 (
    • Blue Pants 1(

Since there was no easy way to filter for all of these products, I simply created a filter using RegEx that looked like this:
Red Hat 1|Red Shirt 1|Blue Pants 1
This worked well enough, but would return a bunch of other irrelevant products that contained similar terms. So then I created them in an exact match format:
^Red Hat 1$|^Red Shirt 1$|^Blue Pants 1$
That got me the information I wanted. Now picture doing this 20-30 times, and you begin to see why an Excel tool that does the heavy lifting for you comes in quite handy.

Is this a solution you’ve been looking for? Let us know in the comments.

Dan Wilkerson is a Software Engineer at LunaMetrics. He is passionate about web technology, measurement, and analysis. Dan is the winner of the 1999 Forge Road Elementary School Science Fair for his groundbreaking report on how magnets work. (ICP, take note.) Dan has worked at LunaMetrics in social media, as our marketing manager, and now in our analytics department.

  • Sayf

    Nice work, Dan! I’ll make use of this today! It’s like Christmas has come early. No coal for me. No sir. I have this.

  • Dan Haggerty

    Awesome stuff! I’ve been looking for something like this for a while. So awesome that I don’t have to build one on my own now!

  • James

    Not sure this is working – I’ve tried over-writing expressions and don’t seem to get out what I’ve put in…

    Also aren’t you making the expressions longer than they need to be?

    ^Red (Hat|Shirt) 1$|^Blue Pants 1$

    • Dan Wilkerson

      Hey James,

      Yes, they could be shorter – this tool is about brute force, not finesse, hence the redundancies :). Thus far, I’ve had no problems with the tool or overwriting my expressions, but if you can point to something that hasn’t worked that would be extremely helpful.


  • Angela

    The link doesn’t seem to be working to download the Regexinator.

    • Dan Wilkerson

      Hey Angela,

      Not sure why it wasn’t working for you. Tested it last night and again this morning and everything is green. Let me know if you still can’t access it and I’ll send it to you directly.


  • Angela

    It’s magically working now, thanks!

  • Mike

    Hello Dan, this is the kind of filter shortening I’ve been looking for!

    I am testing your
    ^Red Hat 1$|^Red Shirt 1$|^Blue Pants 1$

    method, to make sure I’m doing it correctly, would the custom filter be a INCLUDE, REQUEST URI – set up?

    how would this work also for the following pages?


    is this correct or do I need to think of it different? (see code) any help is appreciated!

    ^pay_or_play 1$|^healthcare_reform_health_plan 1$|^analytics_and_measures 1$

    • Dan Wilkerson

      Hey Mike,

      That looks like it should work to me. Test it out as an include filter inside the GA GUI and see what pages it shows you – it should just show you any page including those exact phrases in the URI.


Contact Us.


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

Follow Us



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