Default generated rxpath VS regular expression

Ask general questions here.
marcushe
Posts: 112
Joined: Tue Apr 14, 2009 6:38 am

Default generated rxpath VS regular expression

Post by marcushe » Mon Jun 22, 2009 2:31 am

When we use RxSpy to snatch a object into repositry, the default rxpath is generated as below:
text[@caption~'^Do\ not\ power\ off\ during\ t']
Is the token '\ ' to represent a blank ? In standard regular expression ,we use '\s' to represent a blank.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Default generated rxpath VS regular expression

Post by Support Team » Mon Jun 22, 2009 12:52 pm

The regular expressions used in RanoreXPath are the standard .NET regular expressions. Usually, you do not need to escape white-spaces, however, the default behavior of the .NET Regex.Escape method (that is used internally) is to escape white-spaces anyway. So, in RxPaths with regular expressions you can use " " and "\ " for white-spaces.
"\s" matches not only white-spaces, but also tabs, new lines, form feeds, and so on. Please, consult the MSDN documentation for more information:
http://msdn.microsoft.com/en-us/library/4edbef7e.aspx

Regards,
Alex
Ranorex Support Team
.
Image

marcushe
Posts: 112
Joined: Tue Apr 14, 2009 6:38 am

Re: Default generated rxpath VS regular expression

Post by marcushe » Tue Jun 23, 2009 1:36 am

Understand.