jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noam Paz <noam....@db.com>
Subject RE: Another Regular Expression question!
Date Fri, 03 Feb 2006 19:12:13 GMT

Steve,
here is an example for replacing the encoded string for "%" with "%":
${__javaScript('${sessID}'.replace("%26%2337%3B"\,"%"))}

Compare the two TTT-strings and you'll see what are the special characters being converted
and what are they converted to.

Best regards / Viele Grüße

Noam Paz




                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

             "Steve Gilbert" <stevegilbert@firstondemand.com>                      
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
      
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

             03.02.2006 20:03                                                            
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                       To

                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                               "JMeter Users List" <jmeter-user@jakarta.apache.org>
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                       cc

                                                                                         
                                                                                         
                 Please respond to                                                       
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

                                                                                         
                                                                                         "JMeter
Users List" <jmeter-user@jakarta.apache.org>                                       
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                 Subject 
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                               RE: Another Regular Expression question!  
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         





Thanks very much for this!!

Ok,, realize the element selection now...

I have no idea how I can sort the special char processing,, so if anyone can give me any ideas
I would be very grateful.

Many Thanks

Steve

-----Original Message-----
From: Noam Paz [mailto:noam.paz@db.com]
Sent: 03 February 2006 18:54
To: JMeter Users List
Subject: RE: Another Regular Expression question!


Steve,
no, $1$ means refering to the first element in parenthesis, $2$ the element in the second
parenthasis etc.
Now you obviously refer to the right parenthesis.
The reason the string is "funny" is the processing of special characters. I'm not sure if
you can control that processing within JMeter. If not,  this can be undone using simple JavaScript
code.

Best regards / Viele Grüße

Noam Paz






             "Steve Gilbert" <stevegilbert@firstondemand.com>

             03.02.2006 19:45                                                            
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                       To
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                               "JMeter Users List" <jmeter-user@jakarta.apache.org>
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                       cc
                                                                                         
                                                                                         
                 Please respond to
                                                                                         
                                                                                         "JMeter
Users List" <jmeter-user@jakarta.apache.org>                                       
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                 Subject
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                               RE: Another Regular Expression question!










Errrr,,

No, I was using $1$,, perhaps that's why I'm getting funny results??

This is the string I should have picked up:

TTT05-->370508684688967805480AC9E7zNs4j8G2W3zoPxx+Lg54oZ0PiYrwSE/S7d61uI=

This is what it turned into!!:

TTT05--%3E370508684688967805480AC9E7zNs4j8G2W3zoPxx%2BLg54oZ0PiYrwSE%2FS7d61uI%



-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com]
Sent: 03 February 2006 18:30
To: JMeter Users List
Subject: Re: Another Regular Expression question!

Did you use $2$ to pick up the value?

If you want to use $1$ you could try:

(?s)<PRE>TTT(.+?)</PRE>

Remember that $0$ contains the entire matched string - this can be
useful for checking.

S.
On 03/02/06, Steve Gilbert <stevegilbert@firstondemand.com> wrote:
> Hi,,
>
> Tried that but couldn't get it to work...
>
> -----Original Message-----
> From: Noam Paz [mailto:noam.paz@db.com]
> Sent: 03 February 2006 16:12
> To: JMeter Users List
> Subject: Re: Another Regular Expression question!
>
>
> Hi,
> try the following:
>
> (?s)(<PRE>TTT(.*?)</PRE>)
>
> Best regards / Viele Grüße
>
> Noam Paz
>
>
>
>
>
>             "Steve Gilbert" <stevegilbert@firstondemand.com>
>
>             03.02.2006 16:51                                                        
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
 To
>                                                                                     
                                                                                         
                                                                                         
                                                                                         
                                                   "JMeter Users List" <jmeter-user@jakarta.apache.org>
>                                                                                     
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
 cc
>                                                                                     
                                                                                         
                     Please respond to
>                                                                                     
                                                                                         
   "JMeter Users List" <jmeter-user@jakarta.apache.org>                            
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
  Subject
>                                                                                     
                                                                                         
                                                                                         
                                                                                         
                                                   Another Regular Expression question!
>
>
>
>
>
>
>
>
>
>
> Hi All,,
>
> Hope you can help,, I'm not too good with Regular Expressions so would
> very much appreciate anyone who can help!!
>
> Below is an example of a (part) response I get for the software under
> test.
>
> I am trying to retrieve the long string in between the <PRE> and </PRE>
> (near the end of the response)
>
> The string can vary in length and contents; the only thing that is
> constant is that it will start with a 'TTT'
>
> Thanks
>
> Steve
>
>      <td colspan=4 align=left class="PROMPTBLACK">Fri Feb 03 15:44:51
> GMT 2006</td>
>    </tr>
>  </table>
> <hr/>
> </body>
> </html>
>
>
> <H3>Token Generation Response</H3>
> <table cellspacing="2" cellpadding="2" border="0" width="50%">
>  <tr>
>    <td class="PROMPTBLACK">isSuccessful</td>
>    <td class="PROMPTBLACK">
>      true
>
>    </td>
>  </tr>
>  <tr>
>    <td class="PROMPTBLACK">Error Message</td>
>    <td class="PROMPTBLACK">
>
>
>    </td>
>  </tr>
>  <tr>
>    <td class="PROMPTBLACK">Response Content Type</td>
>    <td class="PROMPTBLACK">
>      text/plain
>
>    </td>
>  </tr>
>  <tr>
>    <td class="PROMPTBLACK">Response Data</td>
>    <td class="PROMPTBLACK">
>
> <PRE>TTT22-->849831523748546811210fCMfzNnBDhqGaM5DeCW7iw==DO+n4M4sRlNtJl
> EtePG8ygptCJ34/fUhkLcy5vA4tlG1wBE75SxSgZVSOUzCkKnMTOTfG78dRK9gn7rqVfX8BF
> D6c+5lee+lKH1K5lOVvHAxnVdCNkt3i8dy1gqXgv9Js8YPVM0DFtCCCAxLaquHBGZ4LRMZxI
> ZBnICmJ08iqeCcBjenw/lLDTHD2yP05wzZGOVzZ999qsh1/aym6whNvJv2GscXZmSlRl7/6k
> OvgD3f3rfS4M1vk8JHOWAPrq970fuduEyWCiPqW/B2JxbcjZnRPzAG9FDrokMw9C2Drg1Qd4
> 4qCwGFvUXxL83EiaKbM4pCTbBWYyHK7qiNzXanLA==</PRE>
>
>    </td>
>  </tr>
> </table>
>
> </body>
> </html>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>
>
>
> --
>
> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn
Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren
Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
>
> This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender immediately
and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.
>
>
>
> ---------------------------------------------------------------------
> 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





--

Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie
nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren
Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.



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






--

Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie
nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren
Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.



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


Mime
View raw message