Replacing words matching regular expressions