add_regex_extractor
Extract values from non-JSON HTTP responses via regex capture groups and save them as JMeter variables. Add an extractor under an HTTP sampler to store matched response data.
Instructions
Add a Regular Expression Extractor under an HTTP sampler, to save a value from its response (body, headers, etc.) into a variable using a regex capture group. Use this instead of add_json_extractor for non-JSON (HTML/XML/plain-text) responses.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"planId": "<planId>",
"parentId": "<parentId>",
"referenceName": "<referenceName>",
"regex": "<regex>"
},
"name": "add_regex_extractor"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Regular Expression Extractor | |
| regex | Yes | Regular expression with at least one capture group | |
| planId | Yes | ||
| parentId | Yes | Id of the HTTP sampler node this extractor applies to | |
| template | No | Which capture group(s) to store, e.g. '$1$' | $1$ |
| matchNumber | No | Which match to use (1 = first); 0 = random match; negative = all matches | |
| defaultValue | No | Value to use if the regex doesn't match | NOT_FOUND |
| referenceName | Yes | JMeter variable name to store the extracted value in |