Micro Focus QTP (UFT) Forums

Full Version: Need Any digit in xpath path using Regular expression
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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. [ ]  --> \[ \]