What is RegEx
RegEx is a short for Regular Expressions. It is a sequence of characters to define a search pattern. It comes in handy when you have to find or match a large number of strings based on a pattern.
Usage within Analytics and Tag Manager Solutions
RegEx are used extensively in analytics tools to define a pattern to find matching urls, pages, filter in or out certain content, group pages, create sgements etc.
For example, in Google Analytics, you can create "Content Grouping" of all pages that are in a particular sub-directory and then use the name of sub-directory as the name of the Content Group. So if you group your articles in blog in sub-directories such as /blog/adobe/, /blog/google/, /blog/observepoint/ etc. then a pattern like /blog/(.*?) will match all these patterns. (To learn more about Content Grouping enroll in Advanced Google Analytics course)
Here are some resources for you to learn and verify the your RegEx
- Quick Reference Guide - https://www.regular-expressions.info/refquick.html
- Another Guide - https://www.rexegg.com/regex-quickstart.html
- Test RegEx - https://regex101.com/
- Google Analytics RegEx Help and Guide - https://support.google.com/analytics/answer/1034324?hl=en&ref_topic=1034375
Bookmark this page for future reference.