On 18/12/2007, Ravindra Gupta <[EMAIL PROTECTED]> wrote:
> Hi Everybody,
>
> I am having problem with regular expression. The below given code is
> actually is a part of table and repeated mannier times with unique id
> (yellow marked):
>
>  <td>&nbsp; 11220</td>
> <td>&nbsp; rgupta/10.4.30.245</td>
> <td>&nbsp; Integration Framework Job</td>
> <td>&nbsp; Export - RFX - </td>
> <td>&nbsp; 07-12-17 05:44:37.652</td>
> <td>&nbsp; NormalWithresults</td>
> <td>&nbsp; 07-12-17 05:44:38.375</td>
> <td>&nbsp; 07-12-17 05:45:17.372 [38 secs ] </td>
> <td>&nbsp; 1</td>
>
> the regex that i am using is:
>
> ${job_id}</td>(\n.*)(.*[\n\r]){7}.*<td>&nbsp;.*\[(\d*)? secs

It does not make sense to follow (\n.*) with (.* etc) - ".*" should
never be followed by ".*". Also why are you using \n in one place and
\n\r in the next?

(\d*)? is also rather odd - match zero or more digits if present. No
point in having both * and ? in that expression.

It looks like you are trying to skip a certain number of lines.

I think I would ignore counting lines and just look for [nnn secs as below:

(?s)${job_id}</td>[^[]+\[(\d+) secs\s+\]\s*</td>

This assumes that "[" does not ever occur in the table before [38 secs.

Otherwise, use

(?s)${job_id}</td>.+?\[(\d+) secs\s+\]\s*</td>

which will be a bit slower as the .+ may have to backtrack.

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

Obviously if you want to use that for testing, you'll need to provide
the actual value of ${job_id}.


> where "job_id" is the id i am capturing from other regular expression. The
> value passed to this expression is correct as I have checked by passing it
> to some sampler. Can you please let me know where I am wrong in the reg
> expression?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to