You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "S.D." <si...@gmail.com> on 2009/07/23 18:00:17 UTC

Regular Expression Extractor in Html

Hi.

I'm having some trouble with the regular expression extractor.  I can't
seem to get the right Jmeter regex to work, though other regex's do.  I
feel like the line breaks in the response might be messing me up .. 

I'm trying to extract the user name from the response with an assertion.
I have this expression in my extractor.  It is set to look at the
response text and the boolean is 'Contains'.  My template is set to $1
$: 

The current user is:\r+(.*)

<font color="red">The current user is:
LASTNAME, FIRSTNAME INITIAL

</font>

Shouldn't this work ?  I never seem to find anything.

Thanks !
--sidd


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


Re: Regular Expression Extractor in Html

Posted by "S.D." <si...@gmail.com>.
Thank you ..

That worked perfectly !

> \r only matches CR; you also need to match \n (LF)
> 
> Try
> 
> The current user is:[\r\n]+(.*)



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


Re: Regular Expression Extractor in Html

Posted by sebb <se...@gmail.com>.
On 23/07/2009, S.D. <si...@gmail.com> wrote:
> Hi.
>
>  I'm having some trouble with the regular expression extractor.  I can't
>  seem to get the right Jmeter regex to work, though other regex's do.  I
>  feel like the line breaks in the response might be messing me up ..

See:

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

>  I'm trying to extract the user name from the response with an assertion.
>  I have this expression in my extractor.  It is set to look at the
>  response text and the boolean is 'Contains'.  My template is set to $1
>  $:
>
>  The current user is:\r+(.*)

\r only matches CR; you also need to match \n (LF)

Try

The current user is:[\r\n]+(.*)

You can test using

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

>  <font color="red">The current user is:
>  LASTNAME, FIRSTNAME INITIAL
>
>  </font>
>
>  Shouldn't this work ?  I never seem to find anything.
>
>  Thanks !
>  --sidd
>
>
>  ---------------------------------------------------------------------
>  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