While the sexeger solution which I popularized a few years ago is a good solution for this, it's probably overkill. Either do as shown above: /^[^?]*whatever/, or use a technique that is extensible for when the "?" thing is more than just one character in length: /^(?!.*XXX.*$pattern).*$pattern/. That will match $pattern that is not preceded by XXX.
Jeff japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and perlhacker How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart