OT: in Emacs, you could prevent this from happening by using C-u M-% (replace-word): in that case, only those instances of "div" that are separate words (not parts of other words) will be replaced.
How would you avoid "inpiduals" (and similar mistakes) in other editors?