Skip to content

RegEx User Parameters

Configure the JMeter RegEx User Parameters pre processors: properties, defaults, and practical usage notes for building reliable load tests.

Difficulty
intermediate
Guide type
reference
Estimated read time
2 min read
Last verified version
Verified JMeter 5.6

Part of the Pre Processors category. Also documented in context in the full Component Reference.

RegEx User Parameters

Allows to specify dynamic values for HTTP parameters extracted from another HTTP Request using regular expressions. RegEx User Parameters are specific to individual threads.

This component allows you to specify reference name of a regular expression that extracts names and values of HTTP request parameters. Regular expression group numbers must be specified for parameterโ€™s name and also for parameterโ€™s value. Replacement will only occur for parameters in the Sampler that uses this RegEx User Parameters which name matches

NameRequiredDescription
NameNoDescriptive name for this element that is shown in the tree.
Regular Expression Reference NameYesName of a reference to a regular expression
Parameter names regexp group numberYesGroup number of regular expression used to extract parameter names
Parameter values regex group numberYesGroup number of regular expression used to extract parameter values

Suppose we have a request which returns a form with 3 input parameters and we want to extract the value of 2 of them to inject them in next request

  1. Create Post Processor Regular Expression for first HTTP Request - refName - set name of a regular expression Expression (listParams) - regular expression - expression that will extract input names and input values attributes Ex: input name="([^"]+?)" value="([^"]+?)" - template - would be empty - match nr - -1 (in order to iterate through all the possible matches)

  2. Create Pre Processor RegEx User Parameters for second HTTP Request - refName - set the same reference name of a regular expression, would be listParams in our example - parameter names group number - group number of regular expression for parameter names, would be 1 in our example - parameter values group number - group number of regular expression for parameter values, would be 2 in our example

    See also the Regular Expression Extractor element, which is used to extract parameters names and values

On this page