You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Paul Kronquist <pk...@uscentral.org> on 2004/11/29 16:27:17 UTC

Using variables in Regular Expression Extractor

Is it possible to use a variable as part of a regular expression
extractor query?

This is my scenario:

 

A regular expression extractor extracts a value from the response of
an HTTP Request and assigns it to a variable.

Later, that variable is plugged in to another regular expression
extractor attached to the response of another HTTP request.

 

So, the second regular expression extractor looks something like this:

 

Reference name: test

Regular expression: <!-- ${oid}, (.+?), (.+?) -->

Template: $1$

Match no.: 0

Default: 999999

 

Thanks for your help!

 

Paul Kronquist

 


Re: Using variables in Regular Expression Extractor

Posted by sebb <se...@gmail.com>.
AFAIK, this should work OK, so long as the variable has been defined
before it is needed.

[Multiple Regexes acting on the same sampler may not be processed in
the order you expect, but this should not affect you as you are using
two different samplers]

You can always try it out using a JavaTest sampler - this allows you
to put whatever you like in the response body.

S.

On Mon, 29 Nov 2004 09:27:17 -0600, Paul Kronquist
<pk...@uscentral.org> wrote:
> Is it possible to use a variable as part of a regular expression
> extractor query?
> 
> This is my scenario:
> 
> A regular expression extractor extracts a value from the response of
> an HTTP Request and assigns it to a variable.
> 
> Later, that variable is plugged in to another regular expression
> extractor attached to the response of another HTTP request.
> 
> So, the second regular expression extractor looks something like this:
> 
> Reference name: test
> 
> Regular expression: <!-- ${oid}, (.+?), (.+?) -->
> 
> Template: $1$
> 
> Match no.: 0
> 
> Default: 999999
> 
> Thanks for your help!
> 
> 
> Paul Kronquist
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org