Desperately Seeking Santa
MATLAB: 110 ,95 characters

f=@(x,y) filter2(ones(x),y);a=M==83;b=M==82;c=M==80;d=f(5,a&amp;f(5,b)&gt;3&amp;f(3,c))&amp;(a|b|c);if ~d,M,else,M(~d)=32,end


Not sure about the way input is supposed to be processed, but the rest is pretty straightforward.

Normally formatted version:

f=@(x,y) filter2(ones(x),y);
a=M==83;
b=M==82;
c=M==80;
d=f(5,a&amp;f(5,b)&gt;3&amp;f(3,c))&amp;(a|b|c);
if ~d
  M
else
  M(~d)=32
end


Example input:

M=['***********'
'***********'
'***********'
'*****R*****'
'******P****'
'*****SQL_2*'
'*****R*****'
'****R**R***'
'***********'
'***********'
'***********'
'***********'];