You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Alan Chan <al...@messagecast.net> on 2004/04/15 21:52:08 UTC

Finding the number of occurences of a given string

Hi,

 

>From a given long string contained in a variable, I would like to get
the number of occurrences of a certain substring that I also provide.

 

For example, if I have a user defined variable called ${text} which
contains "example 1 example 2 example 3", and my substring to match is
"example", then the output should be 3.

 

I was trying to use regular expressions extractor and the regular
expressions function for this but could not figure out how to make it to
output the number of occurrences.

 

This is the Perl statement that I am trying to convert to something
JMeter can understand:

 

$text = "example 1 example 2 example 3";

print ($text =~ s/example/example/g);

 

the output is 3

 

 

I also tried using the extended Perl regular expressions, but couldn't
get it to work either.

 

Any help would be much appreciated.

 

Thanks,

~Alan Chan

 

 

 


HTTP Status Code 500?

Posted by Ryo Sode <ry...@filemaker.com>.
Hi,

I have come across a behavior which I am having hard time deciding whether
it's a bug or an intentional behavior.

When a JMeter HTTP sampler with a Response Assertion makes a request and the
HTTP status code in the server response is 500 (i.e. Unexpected error) no
matter what kind of Response Assertion I setup, (e.g. Response Code = 500 or
Response body = Unexpected Error) the test always comes out to be fail.

Can someone tell me if this is the correct behavior or if this is a bug?
Thanks.

Ryo 



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