BufOpen hook is only called for file buffers
remove String::replace, use boost::regex_replace directly