How to use Regular expression for numbers?

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

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...

*//text[@name~'REQUESTS*']

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.
Regards,
Thangavel.S

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

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

Please, read the documentation on regular expressions in RanoreXPaths:
http://www.ranorex.com/support/user-gui ... html#c1791

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

Code: Select all

*//text[@name~'^REQUESTS.*']
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: http://msdn.microsoft.com/en-us/library/hs600312.aspx

Regards,
Alex
Ranorex Support Team