Upcoming LunaMetrics Seminars
Boston, Oct 6-10 Chicago, Oct 20-24 Seattle, Nov 3-7 New York City, Nov 17-21

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.”

Backslashes \
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
{Braces}
Minimal Matching
Lookahead

Robbin

Robbin Steif

About Robbin Steif

Our owner and CEO, Robbin Steif, started LunaMetrics ten 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 recent winner of a BusinessWomen First award, as well as a Diamond Award for business leadership.

http://www.lunametrics.com/blog/2006/10/04/regular-expressions-part-vi-or/

One Response to “Regular Expressions Part VI: OR”

[...] Robbin Steif has done a really great starter on this one. Regular Expressions Part VI: OR [...]