You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Kapil Khanna Avolent <kk...@avolent.com> on 2008/01/07 22:37:43 UTC

Regular Expression

Hi,
 
I'm trying to extract the following string using Regular expression as
specified
 
String: requestType=AJAX&AJAXOpHandler=&sid=0.2566145450023796&mode
 
RE : requestType=AJAXOpHandler=\&sid=(0\.)(\d*)\&mode
 
p.s : I have tried this with \0\.(\d*) also
 
but when I'm using the RE variable, its simply printing the variable
name instead of the extracted string.
 
Could anyone explain how exactly I can use RE here.
 
Thanks.

RE: Regular Expression

Posted by Kapil Khanna Avolent <kk...@avolent.com>.
Thanks, mine worked without adding the prefix and sufix too. I was doing
a little error which I found other than RE :)

Thanks once again. 

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Monday, January 07, 2008 2:37 PM
To: JMeter Users List
Subject: Re: Regular Expression

Try

&sid=(\d\.\d+)&

Add extra prefix and suffix as necessary to disambiguate if sid can
appear elsewhere.

On 07/01/2008, Kapil Khanna Avolent <kk...@avolent.com> wrote:
> Basically, I want to extract the sid (which is dynamic) in a sid 
> variabale from the following string:
>
> requestType=AJAX&AJAXOpHandler=&sid=0.5439641459902905&mode=existing&d
> is 
> playMode=thumbnail&widgetName=ViewConsolidatedInvoiceButton&OP=display
>
> And when its trying to GET the HTTP request, I'm passing all these as 
> parameters and for the sid,I'm passing the ${sid} variable, but its 
> not getting what its suppose to get.
>
>
> Thanks!
>
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Monday, January 07, 2008 1:58 PM
> To: JMeter Users List
> Subject: Re: Regular Expression
>
> On 07/01/2008, Kapil Khanna Avolent <kk...@avolent.com> wrote:
> > Hi,
> >
> > I'm trying to extract the following string using Regular expression 
> > as
>
> > specified
> >
> > String: requestType=AJAX&AJAXOpHandler=&sid=0.2566145450023796&mode
> >
>
> Which part of the string do you want to extract?
>
> > RE : requestType=AJAXOpHandler=\&sid=(0\.)(\d*)\&mode
>
> What happened to AJAX& ?
>
> No need to escape the & characters.
>
> Use the RE tester at:
>
> http://jakarta.apache.org/oro/demo.html
>
> > p.s : I have tried this with \0\.(\d*) also
> >
> > but when I'm using the RE variable, its simply printing the variable

> > name instead of the extracted string.
> >
>
> Try providing a default.
>
> > Could anyone explain how exactly I can use RE here.
> >
> > Thanks.
> >
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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


Re: Regular Expression

Posted by sebb <se...@gmail.com>.
Try

&sid=(\d\.\d+)&

Add extra prefix and suffix as necessary to disambiguate if sid can
appear elsewhere.

On 07/01/2008, Kapil Khanna Avolent <kk...@avolent.com> wrote:
> Basically, I want to extract the sid (which is dynamic) in a sid
> variabale from the following string:
>
> requestType=AJAX&AJAXOpHandler=&sid=0.5439641459902905&mode=existing&dis
> playMode=thumbnail&widgetName=ViewConsolidatedInvoiceButton&OP=display
>
> And when its trying to GET the HTTP request, I'm passing all these as
> parameters and for the sid,I'm passing the ${sid} variable, but its not
> getting what its suppose to get.
>
>
> Thanks!
>
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Monday, January 07, 2008 1:58 PM
> To: JMeter Users List
> Subject: Re: Regular Expression
>
> On 07/01/2008, Kapil Khanna Avolent <kk...@avolent.com> wrote:
> > Hi,
> >
> > I'm trying to extract the following string using Regular expression as
>
> > specified
> >
> > String: requestType=AJAX&AJAXOpHandler=&sid=0.2566145450023796&mode
> >
>
> Which part of the string do you want to extract?
>
> > RE : requestType=AJAXOpHandler=\&sid=(0\.)(\d*)\&mode
>
> What happened to AJAX& ?
>
> No need to escape the & characters.
>
> Use the RE tester at:
>
> http://jakarta.apache.org/oro/demo.html
>
> > p.s : I have tried this with \0\.(\d*) also
> >
> > but when I'm using the RE variable, its simply printing the variable
> > name instead of the extracted string.
> >
>
> Try providing a default.
>
> > Could anyone explain how exactly I can use RE here.
> >
> > Thanks.
> >
>
> ---------------------------------------------------------------------
> 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
>
>

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


RE: Regular Expression

Posted by Kapil Khanna Avolent <kk...@avolent.com>.
Basically, I want to extract the sid (which is dynamic) in a sid
variabale from the following string:

requestType=AJAX&AJAXOpHandler=&sid=0.5439641459902905&mode=existing&dis
playMode=thumbnail&widgetName=ViewConsolidatedInvoiceButton&OP=display

And when its trying to GET the HTTP request, I'm passing all these as
parameters and for the sid,I'm passing the ${sid} variable, but its not
getting what its suppose to get.


Thanks!



-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Monday, January 07, 2008 1:58 PM
To: JMeter Users List
Subject: Re: Regular Expression

On 07/01/2008, Kapil Khanna Avolent <kk...@avolent.com> wrote:
> Hi,
>
> I'm trying to extract the following string using Regular expression as

> specified
>
> String: requestType=AJAX&AJAXOpHandler=&sid=0.2566145450023796&mode
>

Which part of the string do you want to extract?

> RE : requestType=AJAXOpHandler=\&sid=(0\.)(\d*)\&mode

What happened to AJAX& ?

No need to escape the & characters.

Use the RE tester at:

http://jakarta.apache.org/oro/demo.html

> p.s : I have tried this with \0\.(\d*) also
>
> but when I'm using the RE variable, its simply printing the variable 
> name instead of the extracted string.
>

Try providing a default.

> Could anyone explain how exactly I can use RE here.
>
> Thanks.
>

---------------------------------------------------------------------
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


Re: Regular Expression

Posted by sebb <se...@gmail.com>.
On 07/01/2008, Kapil Khanna Avolent <kk...@avolent.com> wrote:
> Hi,
>
> I'm trying to extract the following string using Regular expression as
> specified
>
> String: requestType=AJAX&AJAXOpHandler=&sid=0.2566145450023796&mode
>

Which part of the string do you want to extract?

> RE : requestType=AJAXOpHandler=\&sid=(0\.)(\d*)\&mode

What happened to AJAX& ?

No need to escape the & characters.

Use the RE tester at:

http://jakarta.apache.org/oro/demo.html

> p.s : I have tried this with \0\.(\d*) also
>
> but when I'm using the RE variable, its simply printing the variable
> name instead of the extracted string.
>

Try providing a default.

> Could anyone explain how exactly I can use RE here.
>
> Thanks.
>

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