More Resources

 

Note on Regular Expression Characters

 

It is essential to point out that the regular expression features supported by Qualaroo depend on those supported by JavaScript. Consequently, these regular expression features are not supported by Qualaroo:

  • s (single-line mode) and x (extended syntax) flag

  • a e l u L U E Q A Z z G escape sequences

  • (?<= ) positive look-behind anchor and the (?<! ) negative look-behind anchor

  • (?# ) comment and the other extended (? ) syntax.

 

Regular Expression Testing

 

Regex101.com

A few tools let you test your regular expressions and see if the URLs you want are matched. The one we use most frequently is https://regex101.com/, and it's free, provides lots of explanations for each part of the regular expression, and has a field where you can test sample URLs to ensure they match or don't match.

At the bottom of that site is a grid of the most common regex characters. Don't be afraid to check it if you're unsure about something! There are a few more listed than what is in this guide, but their meanings aren't too difficult to understand. They also have a "complete reference" portion - most of this is targeted at programmers, and while they can use these characters in URL regular expression, most won't be relevant.

 

RegexPal.com

Another great tool is https://www.regexpal.com/. It is very similar to https://regex101.com/, but it allows you to test multiple URLs against your regex at the same time. Efficiency!

 

Regular Expressions for Google Analytics

 

Thijsvannoort.nl

Thijsvannoort.nl puts out a fantastic ebook on Regular Expressions for Google Analytics. It goes over the basics of regular expressions and how to apply them to Google Analytics. 

 

Lookaheads and Lookbehinds

 

RexEgg.com

This page goes further in-depth on lookaheads and lookbehinds: http://www.rexegg.com/regex-lookarounds.html. In general, it's a fantastic regex tutorial site. http://www.rexegg.com/

 

Forging Bravely into the Great Unknown

 

Google Search

As in most things, Google Is Your Friend. However, Google is complicated to use for help with regexes because it explicitly excludes punctuation from search results. You know, things like .*, (?! ), \/. All The good stuff that makes regular expressions possible. A workaround is to preface every search with "regex" and use words to describe what you want to do. It's not the best solution, but until some whiz kid invents a new kind of search engine, this is what we have.

 

StackOverflow.com

Stack Overflow is an excellent resource for all things programming - you ask questions, and other random programmer-type people on the internet help you. Sometimes they aren't very friendly; sometimes they're fantastic, occasionally awesome and nice, but totally wrong! Hence, you should always check a few different places to ensure they have the same answer, and always test your regex before it goes live. A lot of people have asked a lot of questions, though, and frequently, these threads are what will come up in your searches.

All Fun and No Play

RegexCrossword.com

If you need a little more practice before you're ready to start making these on your own, play around with https://regexcrossword.com/. They have a series of crossword-style puzzles, increasing in difficulty, that will help you get comfortable with the regex characters and combinations. The puzzles are also a little nerdy, so you may want to re-read Hitchhiker's Guide To The Galaxy by the time you're through.

Bits and Pieces

Here are some pieces of URLs in regex form that might come in handy. On the internet, copying this kind of thing isn't considered stealing - it's more efficient! If you don't believe us, ask one of your engineers :)

 

https?:\/\/(www\.)? - Start any URL with http(s)://(www.)
[a-zA-Z]{2} - Exactly 2 letters (great for /EN, /fr, /No and other 2-letter language modifiers)
.*(\.[Jj][Pp][Gg]|\.[Gg][Ii][Ff]|\.[Jj][Pp][Ee][Gg]|\.[Pp][Nn][Gg]) - Will match any .jpg, .gif, .jpeg or .png image file, capital or lower case

 

Qualaroo Support

If you get lost at any point or want help troubleshooting your regex, drop the Qualaroo Customer Success Team a line. We're here to help you out! We hope you enjoyed this guide and feel comfortable writing your regular expressions now. You can do it!


 

Was this information helpful?
© 2005 - 2024 ProProfs
-