negation of a phrase in regular expressions

Hi,

I'm building a regular expression, and can't seem find a way to negate a phrase.

I need to find the following phrase

*.png

But to receive false for:

*/GeneratedImage/*.png

I've tried using the following negation lookahead:

String regexp = "/.*/(!?GeneratedImage)/.*\\.png";

But the following line returnes true instead of false:

pattern.matcher("/a/GeneratedImage/zxc.png").find());

HELP! I'm dying here... :(

Thanks,

Rahav

[510 byte] By [Rahava] at [2007-11-27 1:37:46]
# 1
String regex = "/[^/]+/(!?GeneratedImage)[^/]+/[^/]+\\.png";
uncle_alicea at 2007-7-12 0:48:49 > top of Java-index,Java Essentials,Java Programming...