This Fixes #952

The string replacement I have done using regex is a crude way. Need to get a better way to handle this.
@gordonwoodhull you can review this and let me know if you feel there is another better way.