Regular Expressions Part VI: OR


regular-expressionsThis is the sixth installment of my Regular Expression lessons. I am actually learning more than teaching and just sharing as I go along. These are Regular Expressions for Regular People (c), so all the tech-talk is removed. My motivation for learning RegEx, as they are called, is Google Analytics.

OR gets symbolized by the pipe symbol |. The pipe symbol is on my US keyword just above the Enter Key but for some reason looks like two vertical dashes on the keyword itself. It’s incredibly simple, and even Google Analytics does a fabulous job with its description:

This was a hard one to screw up, although they have done a good job of screwing up other easy Regular Expressions.

Here’s an example. One of the sites that I work with is an engineering education site, and they teach both Statics and Finite Element Analysis (FEA). Some people also refer to the latter as FEM (Finite Element Method). If I were only interested in the statics keyword searches, I would probably want to get references to FEA and Finite Element Analysis and FEM out of the search reports. I could do that easily in GA by going to the little filter box that can be found on each report, making it into a red minus sign (so that I am filtering out) and typing in FEA|Finite|FEM . This has the effect of saying, “Get rid of references to anything that includes FEA OR Finite OR FEM.”

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 founder, Robbin Steif, started LunaMetrics in 2004. 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 Diamond Award for business leadership. In 2017, Robbin sold her company to HS2 Solutions and has since retired from LunaMetrics.

Contact Us.

Follow Us



We'll get back to you
in ONE business day.
Our Locations
THE FOUNDRY [map] LunaMetrics

24 S. 18th Street
Suite 100

Pittsburgh, PA 15203


4115 N. Ravenswood
Suite 101
Chicago, IL 60613


2100 Manchester Rd.
Building C, Suite 1750
Wheaton, IL 60187