in reply to Replacing the pattern to search for

you can do it at the command line
perl -pi -e 's/<your pattern>/" " x (length($&))/eg' file