Skip to content

Regular Expressions

Purpose

A regular expression is a sequence of characters that defines a search pattern for strings. It is composed of character literals and special characters. Each character literal represents a single character (such as "a", "b", "C", "1"). Special characters can represent a character, multiple characters, or define choices for matching characters.

Usage

In Rapise, you must prefix regular expressions with the string regex:. For example, the regular expression to match all strings is: regex:.*

Regular expressions have three uses in Rapise: (1) in Object Locators, (2) in action overriding code, and (3) in Custom Libraries.

Examples

Within an Object Locator to match a dynamic Window Title:

window title

regex:.*Microsoft Dynamics NAV matches any Window Title ending with Microsoft Dynamics NAV, for example:

1
Posted Sales Shipments - Microsoft Dynamics NAV

or

1
Sales Invoices - Microsoft Dynamics NAV