You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Stuart Findlay <st...@cp.net> on 2007/09/18 16:38:45 UTC

Match number in regular expression random match

Hi all

In a Regular Expression post-processor with random match number, is 
there a variable set with the match number so subsequent regex's can be 
executed on the same response.

In the following example "summary" and "field4" are always present but 
the other fields may or may not be:

   {
      "summary": "summary1",
      "field1": "field1 text",
      "field2": "field2 text",
      "field4": "field4 text"
   },
   {
      "summary": "summary1",
      "field1": "field1 text",
      "field2": "field2 text",
      "field3": "field3 text",
      "field4": "field4 text"
   },
   {
      "summary": "summary1",
      "field1": "field1 text",
      "field3": "field3 text",
      "field4": "field4 text"
   },

I need to match "summary" at random with "0" match number and then get 
the corresponding "field4" so if I matched the second group then I would 
like to perform the field4 match with match number "2".

Is such a variable set?

Thanks, Stuart




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


Re: Match number in regular expression random match

Posted by sebb <se...@gmail.com>.
On 18/09/2007, Stuart Findlay <st...@cp.net> wrote:
> Hi all
>
> In a Regular Expression post-processor with random match number, is
> there a variable set with the match number so subsequent regex's can be
> executed on the same response.

No.

> In the following example "summary" and "field4" are always present but
> the other fields may or may not be:
>
>   {
>      "summary": "summary1",
>      "field1": "field1 text",
>      "field2": "field2 text",
>      "field4": "field4 text"
>   },
>   {
>      "summary": "summary1",
>      "field1": "field1 text",
>      "field2": "field2 text",
>      "field3": "field3 text",
>      "field4": "field4 text"
>   },
>   {
>      "summary": "summary1",
>      "field1": "field1 text",
>      "field3": "field3 text",
>      "field4": "field4 text"
>   },
>
> I need to match "summary" at random with "0" match number and then get
> the corresponding "field4" so if I matched the second group then I would
> like to perform the field4 match with match number "2".
>
> Is such a variable set?

No; you'll need to match field4 at random instead. If necessary add
some previous context to ensure correct matching.

Else match summary at random, and include everything up to field4
text, then use the RE function to extract the text you want.

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

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