jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: RegExp through multi-line response?
Date Thu, 23 Oct 2008 10:09:52 GMT
On 23/10/2008, Ronan Klyne <ronan.klyne@groupbc.com> wrote:
> l_u_c_f_e_r_13 wrote:
>  > Hi
>  > Could somebody help me with getting proper math from multi-line response?
>  > Lets say I have following response:
>  > ...
>  > <table>
>  >           <tr>
>  >                <td>PRODUCT_NAME_1</td>
>  >                <td> NEEDED_PARAMETER1 View </td>
>  >                <td> NEEDED_PARAMETER2 Detail </td>
>  >          </tr>
>  >           <tr>
>  >                <td>PRODUCT_NAME_2</td>
>  >                <td> NEEDED_PARAMETER1 View </td>
>  >                <td> NEEDED_PARAMETER2 Detail </td>
>  >          </tr>
>  > ...
>  > So I need get NEEDED_PARAMETER1, and NEEDED_PARAMETER2 for PRODUCT_NAME_1 (I
>  > don't knew is it first element in table or not? I just knew the name).
>  > For now I come up with following solution - specify number of "\n" manually.
>  > So my PegExp looked like:
>  > RegExp=$PRODUCT_NAME_1.*?\n.*?href="(.*?)">View.*?\n.*?href="(.*?)">Detail
>  > Template=$1$$2$
>  >
>  > It works fine, but what I want to do it's create RegExp which would not
>  > depends of \n amount.
>  > So for example such RegExp as
>  > PRODUCT_NAME_1((.|\n)*?)href="(.*?)">View((.|\n)*?)href="(.*?)">Detail -
>  > works fine and return desired result as third and sixth subgroups ($3$ $6$ -
>  > in Jmeter). But this regexp doesn't work in Jmeter.
>  > Could somebody help me with it?
>  >
>  > TIA!!
>
>
> You need to put (?m) and the start to make it a multi-line regex. I
>  found this in the ORO API docs (http://jakarta.apache.org/oro/api/ ) but
>  there's probably something a bit friendlier around...
>

Perhaps:

http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html#line_mode

will help?

>         # r
>
>
>  --
>  Ronan Klyne
>  Business Collaborator Developer
>  Tel: +44 01189 028518
>  ronan.klyne@groupbc.com
>  www.groupbc.com
>
>
>  ---------------------------------------------------------------------
>  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


Mime
View raw message