Regular Expressions: a web analyst’s best friend

Ever heard of Regular Expressions? The first time I read the term I thought, “Hmm, so what’s the difference between a regular expression and an irregular expresson?”

Ha ha. 🙂

Since that day I’ve used regular expressions to save time and to cover a lot of ground really fast when searching through large text files (http log files), for text parsing in programming, and when confiiguring web analytics tools.

So, what are regular expressions, anyway? First, you might see them referred to as Regex. Regular Expressions are short, rather cryptic patterns used for finding text within large files. If memory serves, Regex originated in the Perl programming language. Anyway, regular expressions are fast. And handy. (And why on earth aren’t they more widely supported in Omniture?) Many widely used tools such as text editors and many programming languages support various implementations of Regex. Take the time to learn them and you’ll save a lot of time combing through large files trying to find all occurrences of a certain text string.

Web analytics consultancy Lunametrics has kindly released a nice little ebook about Regular Expressions and how they can be used in Google Analytics. It’s a free download – check it out! Your web analytics will be better for your learning effort.

One fantastic tool I use which supports Regex is AstroGrep (available from Sourceforge.net). I frequently use AstroGrep as a programming tool and as a http logfile utility. So useful for finding all log entries for a certain site visitor (sessionalizing a user’s clickstream), etc.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *