How to use regex in UFT object properties

Category:
Question ID: 109988
1
0

I’m pretty new to using regular expresions. Can someone please help implementating of regular expressions in object properties? We are using shared Object Repository in UFT 15.0.2.

I need to use regex in a devname property that can be different based on the loaded customer information.

The originally recorded devname = “CustomerLayout;Customer1Layout;1234”

I need to use this as “CustomerLayout;Customer1Layout;####” (with any 4 digit number at the end).

Marked as spam
Posted by (Questions: 361, Answers: 39)
Asked on January 19, 2021 3:48 pm
11 views
Answers (1)
1
Private answer

In the object repository, go to the object and click in the devname property. Click the "Configure the value" button on the right side of the field. Click the "Regular expression" box and enter the value in the repository parameter Constant field as

CustomerLayout;Customer1Layout;d{4}

This makes the property value as CustomerLayout;Customer1Layout; with any 4 digit number.

You can use the Regular Expression Evaluator to ensure you have the expression set properly. You can find guides to regular expressions doing a web search.

Marked as spam
Posted by (Questions: 16, Answers: 772)
Answered on January 19, 2021 3:50 pm
That worked perfectly. Thanks for the help!
( at January 19, 2021 3:51 pm)