negation of a phrase in regular expressions
807606Apr 19 2007 — edited Apr 19 2007Hi,
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