RxPath Regular Expression

Ask general questions here.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

RxPath Regular Expression

Post by atom » Fri Feb 13, 2009 2:59 pm

When I point the Spy Tool to my window i get :

"/form[@title~'^Sophis\ VALUE\ 3\.3\.5\ -\ \[ROO']"

But when i look at the documentation for RxPath regular expression, nothing is mentioned about "\" and "'" characters, what do they do?

Cheers

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 » Fri Feb 13, 2009 3:36 pm

Special characters in regular expressions need to be escaped (white spaces don't necessarily need to be escaped, but the Regex.Escape method does it anyway), see the RanoreXPath docu for a list of special characters:
http://www.ranorex.com/support/user-gui ... html#c1791

The ' (tick) character just marks the start and end of the attribute value string.

Regards,
Alex
Ranorex Support Team

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Post by atom » Fri Feb 13, 2009 3:40 pm

Ok thanks
What regular expression standard/library are you using?

The strange thing is that the Spy Tool proposes an inexact match by default in my case. It has missed some characters off the title

The exact title is "Sophis VALUE 3.3.5 - [ROOT]"

Cheers

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 » Mon Feb 16, 2009 10:11 am

We use the regular expressions provided by the .NET Framework, in particular the Regex class.

Form titles are by default truncated to regular expressions if their length exceeds RxPath.MaxMatchTextLen. One can change this behavior only in code, e.g. by setting this property to int.MaxValue or by setting TruncationLength property of the corresponding AttributeDescriptor.
We plan to make the configuration of this behavior easier in a future version by providing a visual editor.

Regards,
Alex
Ranorex Support Team