Adsed a program to replace strings using regex in cpp