Re: Regular expression extractor / multiline matching

2005-08-03 Thread sebb
On 03/08/05, Nop Lists <[EMAIL PROTECTED]> wrote:
> Thanks, Sebb, the following works like charm:
> RegExp: (?s)( value="([0-9]*)" selected="selected">)

([0-9]+) would be better, unless you want to match value=""

> Template: $2$
> 
> However I am a bit confused about numbering the template.
> My understanding is:
> $1$ is what matched starting at 

Yes.

In this case it is the same as $0$, because you have enclosed the whole Regex.

So you could drop the outer parentheses and use $1$ instead.

> .*? is not counted as it is not in paranthesis.

Not any more - but previously it _was_ in parentheses.

> $2$ is what matched with ([0-9]*)

Yes, now that (.*) has become .*?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Regular expression extractor / multiline matching

2005-08-03 Thread Nop Lists
Thanks, Sebb, the following works like charm:
RegExp: (?s)()
Template: $2$

However I am a bit confused about numbering the template.
My understanding is:
$1$ is what matched starting at 
.*? 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 <[EMAIL PROTECTED]> wrote:
> 
> On 03/08/05, Nop Lists <[EMAIL PROTECTED]> wrote:
> > Hello,
> > I'm trying to extract the selcted value of a selction box in a form,
> > which looks like this
> >
> >  > onchange="errorMsg('datenInkonsistenz')" style="z-index:1"
> > class="input150px"> > selected="selected">789 1234567 00
> > 789 1234567 01
> > 789 1234567 99
> >
> > Under the HTTP Request Sampler I use a regular
> > expression extractor with the following parameter:
> >
> > Reference Name: secAccountId
> > Regular Expression: (?s) ( > name="orderData.secAccountId"(.*) > 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>


Re: Regular expression extractor / multiline matching

2005-08-03 Thread sebb
On 03/08/05, Nop Lists <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm trying to extract the selcted value of a selction box in a form,
> which looks like this
> 
>  onchange="errorMsg('datenInkonsistenz')" style="z-index:1"
> class="input150px"> selected="selected">789 1234567 00
> 789 1234567 01
> 789 1234567 99
> 
> Under the HTTP Request Sampler I use a regular
> expression extractor with the following parameter:
> 
> Reference Name: secAccountId
> Regular Expression: (?s) ( name="orderData.secAccountId"(.*) 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]