Title says it all. My intention is to insert a space by replacing the match with
Use a negative look ahead for a space:
Although this answers your question as stated, I suspect you actually don't want to match when
// is at the end of a line (which would qualify under your question's definition). If so, use a positive look ahead for a non whitespace char:
Or alternatively, use
\B to match a non-word boundary:
which will possibly impress your colleagues more.