August 6, 2015 by Roman Ožana

How to Use Regular Expressions in Testomato

Photo Credit: Jeff Kubina, Creative Commons 2.0

Testomato supports the use of advanced web page monitoring filtering: regular expressions (regex). This means that you can use regular expression patterns for defining a rule or rules set up to monitor your websites.

What Are Regular Expressions

A regular expression is a sequence of characters that define a search pattern, which is mainly used for string pattern matching and string finding. Basically, they are coded strings that define an infinite number of possible matches.

While regular expressions are not considered a programming language, they do use complex combinations of characters and symbols that can make them difficult to interpret. These special characters which have a special meaning in regex  (known as metacharacters) make regular expressions one of the most powerful and flexible tools for parsing and filtering specific text on a page.

Here’s a quick list of some basic regular expressions:

For more, check out this cheat sheet from RexEgg.

Using Regular Expressions in Testomato

With Rules, you can configure checks to see if a particular word or phrase is present on a page in your website content. You can also create Rules based on whether a particular regular expression matches with website content.

Take a look at the following examples:


1) Check a URL redirects to a location with no other URL parameter followed



  • ^ assert position at start of the string
  • https://testomato\.com/\?backlink= matches the characters literally
  • [^&]+ match everything except & between one and unlimited times
  • $ assert position at the end of the string

2) Check that / is not disallowed in robots.txt, but Disallow: /admin is ok

^Disallow: /$


  • ^ assert position at the start of the line
  • Disallow:/ matches the characters Disallow: / literally
  • $ assert position at the end of a line

3) Check page contains “word test” (but does not match “world contest”) 



  • \b assert position at a word boundary (^\w|$|\W\w|\w\W)
  • test matches the characters test literally
  • \b assert position at a word boundary (^\w|$|\W\w|\w\W)

If you need a quick cheat sheet, you can use to highlight patterns and matches.

Have more questions about using regular expressions in Testomato?

Let us know in the comments below or email our team You can also tweet us directly @testomatocom.

Is your website available? Testomato can check your website availability every 15 seconds from 10 different locations around the world and will send you an alert if the site is unavailable.

Keep track of the important parts of your website with simple checks that can run every minute. They can check plain words, HTML code, HTTP headers, redirects … and much more. Never miss anything.

Websites break, it happens all time. You'll be the first to know. Testomato has an extensive database of and will let you know if it finds any error on monitored url.