if (/^(foobar:((?!=gonk|\@).)+)/) { print "matched $1\n"; }