表达式包含以下参数:定期提取给定一个HTTP响应头参数值
Content-Disposition: attachment; filename="myfile.pdf"
是什么在JMeter的正则表达式来提取文件名myfile.pdf
?我已从filename=".*"
开始,但不知道如何继续。
表达式包含以下参数:定期提取给定一个HTTP响应头参数值
Content-Disposition: attachment; filename="myfile.pdf"
是什么在JMeter的正则表达式来提取文件名myfile.pdf
?我已从filename=".*"
开始,但不知道如何继续。
所有你需要周围有像括号正则表达式的第一:
filename=(.*)
这样的JMeter会知道究竟是什么你正试图捕捉。它会提取"myfile.pdf"
如果您不需要引号 - 将它们添加到您的正则表达式,如:
filename="(.*)"
请确保您有:
参考文献:
虽然@ tim-biegeleisen的答案完美无缺,但我选择了这个答案作为答案,因为的解释。 –
如果您阅读JMeter文档,您会发现这个答案不是最有效的解决方案。 –
尝试使用这样的:
Content-Disposition: attachment; filename="([^"]+)"
说明:
( capture what follows
[^"]+ any non quote character, one or more times
) stop capture
[学习正则表达式]的可能重复(http://stackoverflow.com/questions/4736/learning-regular-expressions) – Biffen