in reply to Re: regex problem
in thread regex problem

The above solution by tlm is clearly superior to that I'm about to suggest here.

But another approach that I've used in environments (like Emacs) that don't have negative lookaheads is:

/if([^f]|$)/
or
/if(?:[^f]|$)/
to ensure nothing is returned in $1 should the regex match.