How to use Regular expression for numbers?

Ask general questions here.
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am

How to use Regular expression for numbers?

Post by thangavel » Tue Jun 09, 2009 1:46 pm

Here is the object's property :
*//text[@name='REQUESTS (11233)']

11233 is changing at runtime. If one request added then it will be 11234. If 1 request completed then the count will be decrease (11232).

I tried to get the object using regular expression as follows...


But i'm not able to get the object.
I'm getting the following error:

No element found for path '*//text[@name~'REQUESTS*']'.

Anyone give me suggestion.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Post by Support Team » Tue Jun 09, 2009 2:12 pm

Please, read the documentation on regular expressions in RanoreXPaths: ... html#c1791

If you want to match anything that starts with "REQUESTS", your regular expression should look like the following:

Code: Select all

You could also narrow the match to numbers:

Code: Select all

*//text[@name~'^REQUESTS ([0-9]*)']
If you need further information on regular expressions, please read the corresponding MSDN site:

Ranorex Support Team