Micro Focus QTP (UFT) Forums
Need Any digit in xpath path using Regular expression - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Need Any digit in xpath path using Regular expression (/Thread-Need-Any-digit-in-xpath-path-using-Regular-expression)



Need Any digit in xpath path using Regular expression - Priyam - 10-04-2016

Below is the string in which I need any digit to be allowed in Table[1] part, since table no. keeps changing. Kindly suggest.
I tried Table[\d], Table[\\d] , Table[?[0-9]], Table[[0-9]+] , however nothing seems to be working. Please suggest


Code:
Browser("name:=PROCESSIT - Powered by ReadSoft - TASK DETAIL").Page("title:=PROCESSIT - Powered by ReadSoft - TASK DETAIL").
WebTable("xpath:=//DIV[@id=""pwAliases::_ccntr""]/DIV[1]/DIV[1]/DIV[2]/DIV[1]/DIV[2]/TABLE[[b]1[/b]]").Highlight



RE: Need Any digit in xpath path using Regular expression - Ankur - 10-05-2016

You need to escape meta characters when using them as literals in regular expressions. In the above example, you need to escape the square brackets. [ ]  --> \[ \]