Forum Discussion

john_van_arkele's avatar
john_van_arkele
New Contributor
11 years ago

[LoadUIWeb] Regular expression for data selector

Hi, I need to use a data selector for a dynamic ID in a response to use in subsequent requests. The reponse looks like this:



request=request1&rid=R67gft*6453GBH"



So I have created a data selector with the name of "rid", subexpression "$1" and with the following regex: 



rid=(.*?)\"



And in the follwing requests I use it as follow:



rid=@rid@



Is this correct? Is the regex not including the "rid=" part, which leads to a request of:



rid=rid=R67gft*6453GBH"



instead of the wanted:



rid=R67gft*6453GBH



Just want to make sure I make the correct regex here.



1 Reply

  • Looks right to me, though if you've wrapped this regex in parenthesis, it itself will be the first subexpression.

    But this test proves that you've got the right expression: http://regexr.com?38981

    If you still have trouble, try changing the subexpression value from $1 to $2, just to see if it is being caught as a subexpression.