Matchers

Filtering Against Data Using Audisto Scripting Language

Matchers work on data that was gathered using scopes. They take data and an argument and return either TRUE if the data matches the argument, FALSE if not.

Matchers may process different kinds of data:

  • Text: Text based matchers process data as text. Case insensitive data is matched in a case insensitive way. Case sensitive data is processed in a case sensitive way.
  • Number: Number based matchers require the data to be a number. They accept only integer numbers as arguments.

Note: It is allowed to process numbers as text. This is valid:

HTTP Status Starts With "3"

Text Related Matchers

The following text processing matchers are available:

  • Contains: Match is successful if the scope contains the desired string
  • Starts With: Match is successful if the scope starts with the desired string
  • Ends With: Match is successful if the scope ends with the desired string
  • Equals: Match is successful if the scope equals the desired string
  • Is Like: Match is successful if the scope equals a string using wildcards. See below for details
  • Matches Regex: Match is successful if the scope matches the given regular expression. We support Java style regular expressions

Each matcher can also be negated by the according negative matches:

  • Does Not Contain: Match is successful if the scope does not contain the desired string
  • Does Not Start With: Match is successful if the scope does not start with the desired string
  • Does Not End With: Match is successful if the scope does not end with the desired string
  • Does Not Equal: Match is successful if the scope does not equal the desired string
  • Is Not Like: Match is successful if the scope does not equal the desired wildcarded string
  • Does Not Match Regex: Match is successful if the scope does not match the given regular expression.

The Is Like matcher supports an asterix as wildcard character, that matches arbitrary many characters.

Path Is Like "/category/*/top-products.html"

Note that without a starting asterix, the given string must start with the pattern. If you use a trailing asterix, the match fits the whole string, else it would fit the shortest possible match. This is relevant when used with URL rewriting.

When defining a match - especially when using Starts With or Ends With - be sure what the scope contains. Also have in mind that regular expressions are powerful but may also be confusing. Don't hesitate to contact us, if you have any questions. We are always eager to help.

There are a lot of regular expression testers on the web, just search for "java regex tester". We particularly liked these:

  • AppSpot. Simple and clean, supports Java.
  • Regex Planet: Supports full fledged Java expressions
  • Regex101: While not supporting Java directly, it explains expressions and allows an estimation of costs

Contains, Ends With, and Starts With do not support wildcards! Use Is Like or regular expressions for that.

Number Related Matchers

The following number related matchers are available to compare the input to a given value:

  • Less Than
  • Less Than Or Equal
  • Greater Than
  • Greater Than Or Equal

To compare numbers for equality, use Equals or Does Not Equal.

Note: Passing text into number based matchers leads to an error.