正则表达式,使用正则表达式提取器在一组参数的末尾提取值

时间:2013-05-03 08:14:17

标签: regex jmeter

我有以下POST数据:

dynamicfields=%7B%221%22%3A%7B%22ID%22%3A1%2C%22Name%22%3A%22Email+Address%22%2C%22Value%22%3A%221%40d.com%22%7D%2C%222%22%3A%7B%22ID%22%3A2%2C%22Name%22%3A%22First+Name%22%2C%22Value%22%3A%22coldplay1%22%7D%2C%225%22%3A%7B%22ID%22%3A5%2C%22Name%22%3A%22Contact+No%22%2C%22Value%22%3A%22%22%7D%2C%226%22%3A%7B%22ID%22%3A6%2C%22Name%22%3A%22Gender%22%2C%22Value%22%3A%22Male%22%7D%2C%224%22%3A%7B%22ID%22%3A4%2C%22Name%22%3A%22Date+of+birth%22%2C%22Value%22%3A%2201%2F1%2F2011%22%7D%2C%223%22%3A%7B%22ID%22%3A3%2C%22Name%22%3A%22Last+Name%22%2C%22Value%22%3A%22%22%7D%2C%227%22%3A%7B%22ID%22%3A7%2C%22Name%22%3A%22Country%22%2C%22Value%22%3A%22%22%7D%2C%228%22%3A%7B%22ID%22%3A8%2C%22Name%22%3A%22Unique+Identity+Type%22%2C%22Value%22%3A%22%22%7D%2C%229%22%3A%7B%22ID%22%3A9%2C%22Name%22%3A%22Unique+Identity+Number%22%2C%22Value%22%3A%22%22%7D%7D&f1=1%40d.com&f2=coldplay1&f5=&f6=Male&v6=&month=01&ddlDate=1&v4=&f4=01%2F1%2F2011&f3=&f7=&f8=&f9=&sk=16dcc29ca6320a4583aa32fa0c5035f7eb9a

我必须提取:

&sk=16dcc29ca6320a4583aa32fa0c5035f7eb9a.

SK的值是会话ID,它在每次迭代中都会不断变化 尝试使用RegExtractor但没有奏效。
RegEx:&sk=(.*?)&sk=(.+?)都无效。

1 个答案:

答案 0 :(得分:1)

试试这个表达式:

  • 及(?+)SK = \ B'/ LI>
如果sk总是在结束时,

\ b表示单词的结尾