jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nop Lists <nop.li...@gmail.com>
Subject Re: Regular expression extractor / multiline matching
Date Wed, 03 Aug 2005 15:25:54 GMT
Thanks, Sebb, the following works like charm:
RegExp: (?s)(<select name="orderData.secAccountId".*?<option 
value="([0-9]*)" selected="selected">)
Template: $2$

However I am a bit confused about numbering the template.
My understanding is:
$1$ is what matched starting at <select and ending at selected">
.*? is not counted as it is not in paranthesis.
$2$ is what matched with ([0-9]*)

Is this correct?

Thanks
Nop

On 8/3/05, sebb <sebbaz@gmail.com> wrote:
> 
> On 03/08/05, Nop Lists <nop.lists@gmail.com> wrote:
> > Hello,
> > I'm trying to extract the selcted value of a selction box in a form,
> > which looks like this
> >
> > <select name="orderData.secAccountId" tabindex="3"
> > onchange="errorMsg('datenInkonsistenz')" style="z-index:1"
> > class="input150px"><option value="789123456700"
> > selected="selected">789 1234567 00</option>
> > <option value="789123456701">789 1234567 01</option>
> > <option value="789123456799">789 1234567 99</option></select>
> >
> > Under the HTTP Request Sampler I use a regular
> > expression extractor with the following parameter:
> >
> > Reference Name: secAccountId
> > Regular Expression: (?s) (<select
> > name="orderData.secAccountId"(.*)<option value="([0-9]*)"
> > selected="selected">)
> 
> .* is greedy and may match more than you intended.
> 
> Use (.*?) or perhaps ([^<]*) instead
> 
> And if you don't want to use groups 1 and 2, why collect them?
> 
> Should probably be using .+ and [0-9]+ anyway ...
> 
> > Template: $2$
> 
> This corresponds to (.*), not ([0-9]*)
> 
> You need to use $3$ or remove the other brackets.
> 
> > Match No.: 1
> > Default Value: NOTFOUND
> >
> > Instead of the value "789123456700" the variable secAccountId has the
> > value "null".
> >
> > Does anybody have an idea what I am doing wrong?
> 
> See above.
> 
> See also the Regex FAQ: 
> http://wiki.apache.org/jakarta-jmeter/RegularExpressions
> 
> S.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message