There's a useful ORO tester at:

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

This shows that

SERVER_(?!ItemTypes)_MDID

does not match

SERVER_Foobar_MDID

Why is that?

Remember that (?!xxx) is a zero-width assertion, so it does not
consume any characters. It does match

SERVER__MDID

(two _ in a row)

So you can try dropping the _MDID from the pattern. If this creates
false positives, then you will need to add something like

\w+ or [^_]+

to consume the characters.

On 05/10/2007, Petteri Heinonen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to check for the following rules in my Response Assertion:
>
> - Response must include string "SERVER_ItemTypes_MDID" string.
> - Response must not include any other "Server_*_MDID" strings.
>
> I have two Response Assertion elements. First one simply checks that
> SERVER_ItemTypes_MDID exists in the response.
>
> But how to define the second one? I have a Response Assertion element
> with "Not" selected in Pattern Matching Rules, and then I've added this
> pattern: SERVER_(?!ItemTypes)_MDID . Now, if there exists for example
> string "SERVER_Foobar_MDID" in the response, it should match that
> pattern, and the assertion should fail. But, for some reason, it doesn't
> match and thus assertion falsely reports success.
>
> Any ideas what might be wrong in my regexp?
>
> Regards, Petteri Heinonen
>
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to