On 05/09/07, Sebastian Straus <[EMAIL PROTECTED]> wrote:
> Hello JMeter-Users,
>
> first of all i want to thank chris for his quick answer regarding my problem
> with the response string in JMeter. I swear i build you a memorial - when
> i've got the time :). My next question is more an additional one to my
> former: I want to get some information from my recieved HTML-File which i
> will get as response.
> I tried it with Regular Expressions, but it doesn't work. My code looks like
> this:
What are you trying to match?
> ----------------------------------------------------------------------------------
> import java.util.regex.*;
> import java.lang.String.*;
>
> String ich = prev.getResponseDataAsString();
> Pattern p = Pattern.compile("[/.-]");
i.e. either / . or -
> Matcher idMatcher = p.matcher(ich);
> boolean matched = idMatcher.matches();
i.e. the entire string is the one character / . or -
Perhaps you meant idMatcher.contains()?
> print(matched);
> -----------------------------------------------------------------------------------
> This one alway results in a false 'matched'-Variable.
>
> If I try something like this, it works and i recieve my results. Can anyone
> tell me why?
Because you are doing something completely different - splitting on /
. or -, rather than matching those characters.
> -----------------------------------------------------------------------------------
> import java.util.regex.*;
> import java.lang.String.*;
>
> String ich = prev.getResponseDataAsString();
> Pattern p = Pattern.compile("[/.-]");
> String[] date1 = p.split(ich);
> print(date1[0]);
> print(date1[1]);
> print(date1[2]);
> print(date1[3]);
> print(date1[4]);
> print(date1[5]);
> print(date1[6]);
> print(date1[7]);
> print(date1[8]);
> print(date1[9]);
> print(date1[10]);
> -----------------------------------------------------------------------------------
> Thank you very much for your support.
>
> Sebastian
>
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]