AIRegex Object

Supported on UFT One versions 2023 and later.


AIRegex is a class that creates an AIRegexObj. The AIRegexObj object contains a regular expression, which provides a text pattern.

Use this object when describing text for AI-based object identification. This enables you to describe the AI-based object using a text pattern the text should match, rather than exact text.


  • AI-based testing is supported on the following technologies:

    • UFT One versions 2022 and later: Web, mobile, and SAP GUI for Windows.

    • UFT One versions 2021 R1 and earlier: Web and mobile.

  • AI objects are supported in UFT One only when:

    • The UFT One Web Add-in, Mobile Add-in, or SAP Solutions Add-in is installed and loaded.
    • The UFT One AI Features are installed and AI is enabled in the UFT One options. For details, see the UFT One Help Center.
  • Use AIRegex in the AIText parameter of the AIUtil.AIObject or AIUtil.FindTextBlock properties that create an AIObject.


The sections below list the built-in methods and properties that you can use as operations for the AIRegex class and the AIRegexObj object.


Property AIRegex.CreateRegexObj

Creates the AIRegexObj Object, which has the Pattern property.


Property AIRegexObj.Pattern

The regular expression represented by this AIRegexObj object.

Back to top

CreateRegexObj Property


Creates an AIRegexObj object containing the specified regular expression.


This is the default property of the AIRegex class, and can therefore be omitted from the syntax.

One of: 

AIRegex.CreateRegexObj (Pattern)

AIRegex (Pattern)



Required. A String value.
The regular expression that describes the text to use.

For details about using regular expressions in AI-based testing, see the UFT One Help Center.

Return Type

An AIRegexObj object.


Back to top


Pattern Property


Returns the regular expression represented by this AIRegexObj object.



Return Type

A String


Back to top

See also: