You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Maya Hague <mh...@yahoo.com> on 2009/05/29 02:48:09 UTC

Regular expression extractor

Hi,

A xml/rpc soap response 3 responses. How do I get the third response into a regular expression. I tried the following . The response returns an interger - ([\d]*)

Reference Name: topic
Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>  
Template:$1$
Match No.:3
Default Value: -1 

The default value gets passed for every call. What am I doing wrong?

Thanks,
maya


      

Re: Regular expression extractor

Posted by Deepak Shetty <sh...@gmail.com>.
oh good to know that
thanks
deepak

On Fri, May 29, 2009 at 3:51 AM, sebb <se...@gmail.com> wrote:

> .* grabs everything, and the ? then makes it back-track when it tries
> to match the next part of the RE.
>
> It's usually more efficient to pick the terminator character - in this
> case '>' and '<' - and use all but that character in the repeat, for
> example:
>
> <topic[^>]*>([^<]*)</topic>
>
> i.e. <topic followed by characters which aren't '>' followed by '>' etc.
>
> But it probably won't make much difference.
>
> On 29/05/2009, Maya Hague <mh...@yahoo.com> wrote:
> > <topic.*?>(.*?)</topic>
> >
> >  worked like a charm. Thanks
> >
> >
> >
> >
> >  ________________________________
> >  From: Deepak Shetty <sh...@gmail.com>
> >  To: JMeter Users List <jm...@jakarta.apache.org>
> >  Sent: Thursday, May 28, 2009 9:39:33 PM
> >  Subject: Re: Regular expression extractor
> >
> >
> >  An  XPATH extractor is probably easier?
> >
> >  If you still want to try regex Id prbably try something like
> >  <topic.*?>(.*?)</topic>
> >
> >  regards
> >  deepak
> >
> >  On Thu, May 28, 2009 at 5:48 PM, Maya Hague <mh...@yahoo.com>
> wrote:
> >
> >  > Hi,
> >  >
> >  > A xml/rpc soap response 3 responses. How do I get the third response
> into a
> >  > regular expression. I tried the following . The response returns an
> interger
> >  > - ([\d]*)
> >  >
> >  > Reference Name: topic
> >  > Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>
> >  > Template:$1$
> >  > Match No.:3
> >  > Default Value: -1
> >  >
> >  > The default value gets passed for every call. What am I doing wrong?
> >  >
> >  > Thanks,
> >  > maya
> >  >
> >  >
> >  >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Regular expression extractor

Posted by sebb <se...@gmail.com>.
.* grabs everything, and the ? then makes it back-track when it tries
to match the next part of the RE.

It's usually more efficient to pick the terminator character - in this
case '>' and '<' - and use all but that character in the repeat, for
example:

<topic[^>]*>([^<]*)</topic>

i.e. <topic followed by characters which aren't '>' followed by '>' etc.

But it probably won't make much difference.

On 29/05/2009, Maya Hague <mh...@yahoo.com> wrote:
> <topic.*?>(.*?)</topic>
>
>  worked like a charm. Thanks
>
>
>
>
>  ________________________________
>  From: Deepak Shetty <sh...@gmail.com>
>  To: JMeter Users List <jm...@jakarta.apache.org>
>  Sent: Thursday, May 28, 2009 9:39:33 PM
>  Subject: Re: Regular expression extractor
>
>
>  An  XPATH extractor is probably easier?
>
>  If you still want to try regex Id prbably try something like
>  <topic.*?>(.*?)</topic>
>
>  regards
>  deepak
>
>  On Thu, May 28, 2009 at 5:48 PM, Maya Hague <mh...@yahoo.com> wrote:
>
>  > Hi,
>  >
>  > A xml/rpc soap response 3 responses. How do I get the third response into a
>  > regular expression. I tried the following . The response returns an interger
>  > - ([\d]*)
>  >
>  > Reference Name: topic
>  > Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>
>  > Template:$1$
>  > Match No.:3
>  > Default Value: -1
>  >
>  > The default value gets passed for every call. What am I doing wrong?
>  >
>  > Thanks,
>  > maya
>  >
>  >
>  >
>
>
>
>

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


Re: Regular expression extractor

Posted by Maya Hague <mh...@yahoo.com>.
<topic.*?>(.*?)</topic> 

worked like a charm. Thanks




________________________________
From: Deepak Shetty <sh...@gmail.com>
To: JMeter Users List <jm...@jakarta.apache.org>
Sent: Thursday, May 28, 2009 9:39:33 PM
Subject: Re: Regular expression extractor

An  XPATH extractor is probably easier?

If you still want to try regex Id prbably try something like
<topic.*?>(.*?)</topic>

regards
deepak

On Thu, May 28, 2009 at 5:48 PM, Maya Hague <mh...@yahoo.com> wrote:

> Hi,
>
> A xml/rpc soap response 3 responses. How do I get the third response into a
> regular expression. I tried the following . The response returns an interger
> - ([\d]*)
>
> Reference Name: topic
> Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>
> Template:$1$
> Match No.:3
> Default Value: -1
>
> The default value gets passed for every call. What am I doing wrong?
>
> Thanks,
> maya
>
>
>



      

Re: Regular expression extractor

Posted by Deepak Shetty <sh...@gmail.com>.
An  XPATH extractor is probably easier?

If you still want to try regex Id prbably try something like
<topic.*?>(.*?)</topic>

regards
deepak

On Thu, May 28, 2009 at 5:48 PM, Maya Hague <mh...@yahoo.com> wrote:

> Hi,
>
> A xml/rpc soap response 3 responses. How do I get the third response into a
> regular expression. I tried the following . The response returns an interger
> - ([\d]*)
>
> Reference Name: topic
> Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>
> Template:$1$
> Match No.:3
> Default Value: -1
>
> The default value gets passed for every call. What am I doing wrong?
>
> Thanks,
> maya
>
>
>

Re: Regular expression extractor

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
you are right , the square brackets shouldnt be present
regards
deepak

On Thu, May 28, 2009 at 6:32 PM, drubix <an...@gmail.com> wrote:

>
> Actually, on second thought, I'm not sure that's right.  Make sure the
> regex
> extractor is acting on the "Body" of the response.
>
>
> drubix wrote:
> >
> > I don't think "\d" is supposed to be in square brackets.  That would
> > probably make it search for words consisting of only the characters "d"
> > and "\" try removing them.
> >
> >
> > Maya Hague wrote:
> >>
> >> Hi,
> >>
> >> A xml/rpc soap response 3 responses. How do I get the third response
> into
> >> a regular expression. I tried the following . The response returns an
> >> interger - ([\d]*)
> >>
> >> Reference Name: topic
> >> Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>
> >> Template:$1$
> >> Match No.:3
> >> Default Value: -1
> >>
> >> The default value gets passed for every call. What am I doing wrong?
> >>
> >> Thanks,
> >> maya
> >>
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Regular-expression-extractor-tp23772597p23772923.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Regular expression extractor

Posted by drubix <an...@gmail.com>.
Actually, on second thought, I'm not sure that's right.  Make sure the regex
extractor is acting on the "Body" of the response.


drubix wrote:
> 
> I don't think "\d" is supposed to be in square brackets.  That would
> probably make it search for words consisting of only the characters "d"
> and "\" try removing them.
> 
> 
> Maya Hague wrote:
>> 
>> Hi,
>> 
>> A xml/rpc soap response 3 responses. How do I get the third response into
>> a regular expression. I tried the following . The response returns an
>> interger - ([\d]*)
>> 
>> Reference Name: topic
>> Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>  
>> Template:$1$
>> Match No.:3
>> Default Value: -1 
>> 
>> The default value gets passed for every call. What am I doing wrong?
>> 
>> Thanks,
>> maya
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Regular-expression-extractor-tp23772597p23772923.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: Regular expression extractor

Posted by drubix <an...@gmail.com>.
I don't think "\d" is supposed to be in square brackets.  That would probably
make it search for words consisting of only the characters "d" and "\" try
removing them.


Maya Hague wrote:
> 
> Hi,
> 
> A xml/rpc soap response 3 responses. How do I get the third response into
> a regular expression. I tried the following . The response returns an
> interger - ([\d]*)
> 
> Reference Name: topic
> Regular Expression: <topic xsi:type='xsd:int'>([\d]*)</topic>  
> Template:$1$
> Match No.:3
> Default Value: -1 
> 
> The default value gets passed for every call. What am I doing wrong?
> 
> Thanks,
> maya
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Regular-expression-extractor-tp23772597p23772912.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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