Hi
http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html

well if your regular expression is something like
<td>([^<]*)</td>
Then $1$ represents the template (i.e. each () expression is assigned a
number and you use $number$ to represent what you want returned)
The matchNo represents which value you want returned - in the above example
it would match 4 times so you could use 1-4 to represent the match you want
. You use 0 if you want a random value and you use -1 if you want all values
(which is what you seem to want).
However note that you get a single dimensional structure  (of 4 matches that
you can iterate over using the for loop controller) but you can have odd
numbered index for column 1 and even numbered index for column2 or use
beanshell to format the data as you want


You could also use something like (untested , so make sure you use something
like a debug sampler and vioew results tree to see what you are getting , i
think the single line modifier (?s) is needed.
(?s)<td>([^<]*)</td>[^<]*<td>([^<]*)</td> and use a template like
$1$-$2$ (i.e. you will get 2 rows returned where each row is delimited by -
i,.e, 1-2,3-4

Finally note that there is nothing identifying your table and you probably
have multiple tables in your page. You are probably better off with a XPath
extractor (where you can use position of table if there really is nothing
identifying the table uniquely

regards
deepak




On Thu, Nov 25, 2010 at 9:19 AM, thanh nguyen <mailinglist...@gmail.com>wrote:

> Hi all,
>
> I have the following table:
>
> <table>
> <tr>
> <td>1 </td>
> <td>2 </td>
> </tr>
> <tr>
> <td>3 </td>
> <td>4 </td>
> </tr>
> </table>
>
> the number of rows are dynamic, but the columns are static.
>
> I want to extract data 1 to 4 and put them in a variable that is an array
> of
> 2 dimensions. I'd use the row and column number to get my data.
> I succeeded to build a regular expression. I put some parentheses () to
> identify the values I want.
> But I don't know how to configure the regular expression extractor's
> template and match No.?
>
> thank you for your help
>
> Thanh
>

Reply via email to