1、正则表达式
Allows the user to extract values from a server response using a Perl-type regular expression. As a post-processor, this element will execute after each Sample request in its scope, applying the regular expression, extracting the requested values, generate the template string, and store the result into the given variable name.
2、JSON Extractor
The JSON PostProcessor enables you extract data from JSON responses using JSON-PATH syntax. This post processor is very similar to Regular expression extractor. It must be placed as a child of HTTP Sampler or any other sampler that has responses. It will allow you to extract in a very easy way text content
比较两段话,JSON Extractor仅仅用于restful风格的http响应数据的提取,而正则表达式的使用范围则广泛的多。特别适用于一些老旧项目中接口请求返回数据内容的获取。